getting proj/modelview matrix

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!

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);

Thanks, this works!