Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Getting the inverse Modelview*Projection Matrix

  1. #1
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Reutlingen, Germany

    Getting the inverse Modelview*Projection Matrix


    Does anyone know, how to get that matrix? Any advice is appreciated.

    GLIM - Immediate Mode Emulation for GL3

  2. #2
    Advanced Member Frequent Contributor plasmonster's Avatar
    Join Date
    Mar 2004

    Re: Getting the inverse Modelview*Projection Matrix

    Code :
    I'm assuming you want to avoid an explicit 
    inverse. If you know the transformations in the
    modelview matrix, you can get the inverse by
    playing some games with matrix properties. For 
    example, if the modelview is nothing more than 
    the camera transformation
    MV = T R
    that is, a rotation followed by a translation, then you could simplify things. 
    The matrix you seek is
    M = (P MV)
    the inverse of the mvp.
    Given the MV above, you have
    M = (P T R) 
    or equivalently
         -1   -1   -1
    M = R   T    P
    Since R is a rotation, the inverse is the 
    transpose; since T is a translation, the inverse 
    is -T; since the inverse of P is given in the 
    red book (and elsewhere), you have
         T      -1
    M = R (-T) P 
    If you follow this reasoning you can unroll your
    matrices and solve them directly.
    Here's a link to a good matrix FAQ:

    Hope this helps.

  3. #3
    Intern Newbie
    Join Date
    Jan 2004

    Re: Getting the inverse Modelview*Projection Matrix

    if ur using shaders theres an easy switch you can use, this is for ARB_Vertex_program type shaders. when specifying the matrix as


    you can simply put


    this works for state matrix's only and in shaders only. there are other matrix modifiers you can use


    hope this is helpful

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts