PDA

View Full Version : OpenGL save matrix?



cronodragon
11-11-2007, 06:19 PM
I'm having problems to setup the camera and perspective matrices, using my own algorithms, not GLUT's ones. I would like to compare the matrices produced by gluLookAt() and gluPerspective(), but I don't know how to retrieve them. I know how to setup a matrix using glMatrixMode() and glLoadMatrix(), but is there something like a glSaveMatrix()?

As always thanks for your help. :D

JernejL
11-11-2007, 07:14 PM
glGetFloatv(GL_MODELVIEW_MATRIX, @matrix_var);

replace GL_MODELVIEW_MATRIX with whatever matrix you want to retrieve.