PDA

View Full Version : glPushMatrix and glPopMatrix?



newmannium
03-01-2001, 09:11 AM
Can somebody do me a favor to tell me:
1) If I use glPushatrix, how can I make
a Matrix? I mean, is it an array?
2) If Matrix is an array, how can I
retrieve every element in the matrix
and put them back to the array
with glPopMatrix?

Thanks a lot and have a nice day!

Deiussum
03-01-2001, 12:02 PM
It's automatic. glPushMatrix will push the current matrix onto the top of the stack. glPopMatrix takes the top matrix on the stack and makes it the current matrix. There's no need to get the actual matrix to use these. If you needed the matrix for other reasons, you can get it using glGetFloatfv, but unless you REALLY need to get the matrix, I'd avoid doing that. Getting information back from OpenGL like that works, but you will take a performance hit.