Part of the Khronos Group
OpenGL.org

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 back the transformation matrix

  1. #1
    Guest

    Getting back the transformation matrix

    How can I get OpenGL to read the current transformation matrix into some int m[][] so that it's individual rows and columns are available to me?

    Plz email me as well as posting a response.

    Thanks, Jordan

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Feb 2000
    Location
    France
    Posts
    1,118

    Re: Getting back the transformation matrix

    You can use:

    GLdouble ProjectionMatrix[16],ModelViewMatrix[16];

    glGetDoublev(GL_PROJECTION_MATRIX,ProjectionMatrix );
    glGetDoublev(GL_MODELVIEW_MATRIX,ModelViewMatrix);

    Then, the indices 0-15 corresponds to the following in the matrix:

    [0 4 8 12]
    [1 5 9 13]
    [2 6 10 14]
    [3 7 11 15]

    Regards.

    Eric

  3. #3
    Guest

    Re: Getting back the transformation matrix

    THANK YOU!!!

    You just saved me about 40 points on my midterm ;-)

Posting Permissions

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