understanding projection matrix elements

This is a discussion on understanding projection matrix elements within the Game Programming forums, part of the General Programming Boards category; after you setransform for the projection matrix, i am outputting the matrix values m_11 to m_44 and dont really understand ...

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

    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
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,235
    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
    306
    so how is rotation scaling used on projection matrix?
    Last edited by Anddos; 07-26-2009 at 12:16 AM.

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    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, 04:57 PM
  3. direct x creating projection matrix
    By Rune Hunter in forum Game Programming
    Replies: 2
    Last Post: 11-05-2005, 08:09 PM
  4. What is a matrix's purpose in OpenGL
    By jimboob in forum Game Programming
    Replies: 5
    Last Post: 11-13-2004, 11:19 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21