Hierarchical Transformations

Hierarchical transformations can be thought of as transformations that are "attached to" other transformations.

They are used to transform objects relative to other objects.


A common use is in articulated bodies.





We can draw this "car" by transforming the two wheels relative to the body of the car.

We'd like to draw each wheel without being affected by, or needing to know about, any other wheels.

apply body transformation
draw body
apply front wheel transformation
draw wheel
remove front wheel transformation
apply rear wheel transformation
draw wheel



glLoadIdentity() would eliminate all transformations.





glPushMatrix() & glPopMatrix() save and restore transformation state.




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

The number of transformations you can save is finite; it is at least 32.




next