Archived

This topic is now archived and is closed to further replies.

_ernie_

dumb

Recommended Posts

_ernie_    122
hi all, im new here as u can tell. i have a q. ive been looking at the tutorial by nehe and he never uses the glPopMatrix() and glPushMatrix() functions. And in other examples they do use them. Why? What are they for exactly?

Share this post


Link to post
Share on other sites
Sphax    122
It allows you to save and load matrices, for example if your current matrix mode is GL_MODEL_VIEW, you can call glPushMatrix() to save the current model view matrix, modify it (with rotations, translations ...) , and then call glPopMatrix() to get the model view matrix as it was before the glPushMatrix.
It''s very usefull when drawing "hierarchical" objects.

Share this post


Link to post
Share on other sites