Sorry if this should have been posted in the advanced forum, anyway heres my question. How do I read the values in an OpenGL matrix. I know how to use glLoadMatrix to use one of my own, I need to be able to save it after proformimg rotation, translation, etc

Thanks

To read the values from a matrix in OpenGL, you can do like this.

GLfloat mvmatrix[16]; //modelview matrix is 16 elements long

GLfloat prmatrix[16]; //… as is the projec tion matrix// now, get the matrices

glGetFloatv(GL_MODELVIEW_MATRIX, mvmatrix);

glGetFloatv(GL_PROJECTION_MATRIX, prmatrix);

Modelview is stored in mvmatrix, and projection is stored in prmatrix.