PDA

View Full Version : Rotation Animation question.



dabeav
08-12-2002, 08:43 AM
Im not sure if this is possible or not, but maybe. Is it possible to rotate only 'certain' verts of an object.

Say I have a model of a person, and i want to make him walk. (Key Frame Animations).

I have the model, and i have an index of what verts belong to what bones. So I would like to be able to rotate those verts around said bone joint (a vert in space)

So would i be able to only rotate certain verts from my vertex array around this joint??
Something like this if the functions existed.

glPushMatrix();
glRotate(Verts with index # 3)
glVertexPointer(3, GL_FLOAT, 0, VertArray);
glPopMatrix();

Now i KNOW, that this cant be done this way, but it always helps to have a visual. Anyone know how this could be done. Im simply trying to create a key frame animation set, with out having to use more than one model per object, or having to change the vert data directly. Thank you.

nexusone
08-12-2002, 11:44 AM
I am not sure that you can do it within a array of verts.
but what you can do it make each moving part a subpart of the whole object.

//object
glPushMatrix();
glTranslatef(....); location of object
glRotatef(....); rotate of whole object

// move head
glPushMatrix();
glTranslatef(...); location of head
glRotatef(....); Rotation of head
draw_head();
glPopMatrix();

// repeat for other moving parts.

glPopMatrix(); // end of object;

The other why to handle object animation is to have complete object's with diffrent poses.

example

My_robot.vert_arry[0]; Standing
My_robot.vert_arry[1]; Raising left foot
My_robot.vert_arry[2]; Raising Right foot
My_robot.vert_arry[3]; Pointing gun.
etc.

dabeav
08-12-2002, 04:13 PM
Well crap, there REALY should be a way to access indidual (indexed) verts within an array. That would make Key Frame animation, REALY fast, NO proccessor involvment, and the actual data would never need to change. I wonder why its never be implemented. Anyone have any other suggestions.

Thanks.

nexusone
08-12-2002, 05:29 PM
I reality the reason is that even if you could change verts in an array. You still have to process the whole array again anyway due to the change.
So there is no speed gain in a changing one vertex in a array vs. using a new array all together.

And I think that I covered the most popular ways of doing animation.

Look at how doom or quake editors work, this will give you some ideas on animation that is used in games



Originally posted by dabeav:
Well crap, there REALY should be a way to access indidual (indexed) verts within an array. That would make Key Frame animation, REALY fast, NO proccessor involvment, and the actual data would never need to change. I wonder why its never be implemented. Anyone have any other suggestions.

Thanks.