Transformations

Hierarchical transformations

glPushMatrix()
glPopMatrix()

glPushMatrix() saves the current transformation state on a stack.
The state is later restored by glPopMatrix().

This is used for creating a hierarchy of transformations. You can define several transformations relative to a single master transformation, by pushing & popping around the sub-transformations.

Make sure you have the same number of pushes & pops.






next