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.

Originally posted by lucidmm:

[b]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?

[/b]

yes

[b]

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

Thanks for your help.[/b]

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