PDA

View Full Version : getting proj/modelview matrix



mjs1
10-16-2004, 11:47 AM
How do I get the modelview or projection matrix? I heard I can do it through glGetDoublev() but what OpenGL state value do I pass it?

Thanks!

farshizzo
10-16-2004, 12:03 PM
Hi,

The following code will get you the modelview and projection matrix.


GLdouble projection[16];
GLdouble modelview[16];

glGetDoublev(GL_PROJECTION_MATRIX,projection);
glGetDoublev(GL_MODELVIEW_MATRIX,modelview);

mjs1
10-16-2004, 12:19 PM
Thanks, this works!