Thread: understanding projection matrix elements

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    319

    understanding projection matrix elements

    after you setransform for the projection matrix, i am outputting the matrix values m_11 to m_44 and dont really understand what each value is doing in terms of projeciton

    is each m_11 to m_14 = x,y,z,w
    m12 to m14 = x,y,z,w
    etc?,

    i need to understand this to learn to change mouse 2d cords to 3d ,
    rayDir.x = v1.x*m._11 + v1.y*m._21 + v1.z*m._31;
    rayDir.y = v1.x*m._12 + v1.y*m._22 + v1.z*m._32;
    rayDir.z = v1.x*m._13 + v1.y*m._23 + v1.z*m._33;
    this formula is taxing my brain atm
    Last edited by Anddos; 07-25-2009 at 09:21 PM.

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Anddos View Post
    after you setransform for the projection matrix, i am outputting the matrix values m_11 to m_44 and dont really understand what each value is doing in terms of projeciton
    Each column of the projection matrix corresponds to a basis vector in a 4 dimensional space. By multiplying a vector by this matrix, you project the vector such that it is re-described in terms of a linear combination of these basis vectors, in other words, it is a change of basis. The reason the projection is four-dimensional is to allow representation of 3-D affine transforms (rotation, scale, and translation) which cannot be directly represented using a three-dimensional matrix.

    This is basic linear algebra stuff, do you have a more specific question?
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    319
    so how is rotation scaling used on projection matrix?
    Last edited by Anddos; 07-26-2009 at 12:16 AM.

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    so how is rotation scaling used on projection matrix?
    It's not per se. Matrices are taken as a whole and then concatenated to produce the final matrix. To understand the final transform is to understand the individual transforms that make up the final transform.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C - access violation
    By uber in forum C Programming
    Replies: 2
    Last Post: 07-08-2009, 01:30 PM
  2. Matrix Help
    By HelpmeMark in forum C++ Programming
    Replies: 27
    Last Post: 03-06-2008, 05:57 PM
  3. direct x creating projection matrix
    By Rune Hunter in forum Game Programming
    Replies: 2
    Last Post: 11-05-2005, 09:09 PM
  4. What is a matrix's purpose in OpenGL
    By jimboob in forum Game Programming
    Replies: 5
    Last Post: 11-14-2004, 12:19 AM