PDA

View Full Version : Obtaining a referece to current matrix



01-12-2003, 07:41 PM
i want to be able to retrieve the values of the 4*4 matrix (it is of type float right?) that is currently in use (ie on the top of the stack)

so in order to do this i get a pointer to the data, but how do i obtain the reference to assign the pointer to?

01-12-2003, 08:25 PM
Never mind, i worked it out
float fProjection[4][4];
glGetFloatv(GL_PROJECTION_MATRIX, &fProjection[0][0]);

and
float fModelView[4][4];
glGetFloatv(GL_MODELVIEW_MATRIX, &fModelview[0][0])