PDA

View Full Version : How can I get the current Matrix



aero
09-11-2001, 03:29 AM
I want to implement a interface with rotated
light,the rotate angle is controlled by
the mouse,but how can I get the current matrix and save it into a matrix for the next rotation?

Coconut
09-11-2001, 06:23 AM
You can save it into its owned stack by

glPushMatrix();

OR

get the matrix by

float mat[16];
glGetFloatv(GL_MODELVIEW_MATRIX, mat);

aero
09-13-2001, 05:15 AM
Originally posted by Coconut:
You can save it into its owned stack by

glPushMatrix();

OR

get the matrix by

float mat[16];
glGetFloatv(GL_MODELVIEW_MATRIX, mat);



Thank you very much!