PDA

View Full Version : glPushMatrix



Vlasko
03-22-2004, 10:27 AM
I'm doing a program witch is switching between Ortho(fot text) and Perpective(everything else) mode can I do following ?
set projection;
glPushMartix();
set to ortho mode
set modelview;
draw text;
set projection;
glPopMatrix(); //will it restore the matrix i was using before ?

mithun_daa
03-22-2004, 10:34 AM
this is how i have it and it works fine. i intially have ortho then i change it to perspective.

initial projection (ortho)...

glMatrixMode(GL_PROJECTION)

glPushMatrix()

glLoadIdentity()
gluPerspective(msngFieldOfView, msngAspectRatio, mdblNearField, mdblFarField)

glPushMatrix()

glMatrixMode(GL_MODELVIEW)
glLoadIdentity()

glPushMatrix()

..............
glPopMatrix()
glPopMatrix()
glPopMatrix()

glFinish() 'finish

'swap the buffers
SwapBuffers(mlngPic1hDC)