PDA

View Full Version : Getting back the transformation matrix



10-19-2000, 06:52 AM
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

Eric
10-19-2000, 07:54 AM
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

10-19-2000, 09:39 AM
THANK YOU!!!

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