PDA

View Full Version : Switching Between MatrixModes



lucidmm
04-23-2002, 08:40 AM
Suppose the current matrix is M and I call the following code fragment.

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);

Then is the modelview matrix still M?
Also, is there a function that returns the current matrix?

Thanks for your help.

Rob The Bloke
04-23-2002, 08:46 AM
Originally posted by lucidmm:
Suppose the current matrix is M and I call the following code fragment.

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);

Then is the modelview matrix still M?


yes


Also, is there a function that returns the current matrix?

Thanks for your help.

check out the functions with glGet at the front. I believe it's glGetFloatfv(GL_MODELVIEW_MATRIX) or something similar.