PDA

View Full Version : Hierarchical Models? Help!



Naveed Ahmed
08-26-2000, 02:23 AM
I've written .MD2 file viewer, now When I load Character and it's Weapon file, and display it at it's initial coordinates, it displays file, like chracter holding the weapons, problems is that when character is animated, moved, how you can move weapon with character's hand, in 3D Studio you can make child objects, like attach weapons to character's hand, so where the hands move the weapon moves, does anything similar can be implemented in OpenGL ?

Gorg
08-26-2000, 08:22 AM
you can do that through glPushMatrix(), glPopMatrix()

example :

rotateUpperbody()
glPushMatrix();
rotaterightShoulder
glPushMatrix();
rotaterightelbow();
glPopMatrix();
glPopMatrix(); --> back to upper body matrix
glPushMatrix();
glrotateleftshoulder()l
glPushMatrix();
glRotateleftelbow();
glPopMatrix();
glPopMatrix(); --> back to upper body again