PDA

View Full Version : Hierarchical Animation



hoganh
11-17-2003, 06:12 AM
Does anyone have the code for a Hierarchical Animation that has at least two branches parented by a common node.
I be grateful of any help.Thanks

nexusone
11-17-2003, 09:08 AM
Use glPushMatrix/glPopMatrix, here is a little example:


// Object
glPushMatrix()
glTranslate // location of main body
glRotate // Rotation of main body
Draw_base()

glPushMatrix() // Create subsection_1
glTranslate // location relative to main boby
glRotate // Rotation relative to main.
Draw_sub_1();

glPushMatrix() // Create subsection_1_2
glTranslate // location relative to subsection_1
glRotate // Rotation relative to subsection_1
Draw_sub_1_2();
glPopMatrix(); // End subsection_1_2
glPopMatrix(); // End subsection_1
glPopMatrix(); // End object



Originally posted by hoganh:
Does anyone have the code for a Hierarchical Animation that has at least two branches parented by a common node.
I be grateful of any help.Thanks