Animate 3D character?

Hi,

One day, I intend to animate a 3D character (make him run, etc.). Now, I can load 3D meshes into my programs, but I don’t know how to animate these characters completely… I can move them around, etc, no problem. But to make individual parts of them move, such as their legs… surely there’s a way of doing this, other than producing meshes for their legs, etc, seperately, then importing them, and rotating and moving these individual parts to simulate walking?
Can I animate 3D characters in my 3D program (3DSM) and then somehow produce an animated mesh?!

See what I mean?

I’m open for any suggestions really. :slight_smile:

Thanks,

Are you asking how to animate a character in general? Or how to do it specifically in opengl? Because it helps to have done one before the other.

There’re two general methods to animate characters; key frame animation (morphing, tweening) and skeletal animation.

The archetypical key frame animation is Quake .MD2. Basically you have a snapshot of the character mesh at different positions in the run cycle (for example). To animate the character running you take two keyed frames, interpolate between the vertices of the two frames (by some percentage) then render the intermediary mesh.

For skeletal animation vertices are assigned to ‘bones’ (matrices) and matrices are stored with the rotation, translation, and scaling for each individual frame of animation. With skeletal animation you can also do physics on the bones enhancing realism.

See NeHe for tutorials about these.

Hi,

I am planning to try a key frame animation of my characters, I just have a small concerns.

For example imagine that i have a world with many buildings homes etc… so completely fixed using VBO to store them in video memory as they are fix i do not need to access their vertex arrays.

Now i have an animal, a cow, that i want to include there for trying to animate my first thing. Its polygons are therefore stored in a vertex array, but sitting in main memory to be able to update it.

My main concerns is that if i have two key frames, to create the animation what should i do, calculate the interpolation at drawing time or generate the 24 frame of a second of animation and storing them in my objet to simply read them at drawing time?

In my opinion the first one risk to make everything crawling down and the second will cost me a huge amount of memory…

So here is the question, what is the best technique to have a smooth (CPU/GPU) efficient animation?

[quote]My main concerns is that if i have two key frames, to create the animation what should i do, calculate the interpolation at drawing time or generate the 24 frame of a second of animation and storing them in my objet to simply read them at drawing time?
[/quote]
You have to interpolate between keys, precomputing frames is the wrong way.EDIT: animation must be time-based to look smooth if you precompute your frames you will have to draw them with a constant framerate of 24fps, if you use interpolation you will not have to care about constant framerate and your animation will play verywell and smoothly even if a latency suddently appear in your framerate.

if your object are static and linked together by pivot you will have the same fps as a non-animated object because for each parts of you animated model you will only send a rotation,translation and send the whole object part the same way you send non-animated one.

I am not clear to what you mean by

"if your object are static and linked together by pivot "

in fact i might have misexplain myself.
Each building is a java object and my character ia also a java object that contains the array of vertices.
and what i consider a frame is a particular state of that array.
And if i need to interpolate i need to do something like

Vert[i]= (1-t) * VertStart[i] + t * VertEnd[i]

And this is what i am fearing is taking time if i have thousand vertices.

Sorry, I misunderstood you, I was talking about skeletal animation as explained by nonnus29 :

[quote]For skeletal animation vertices are assigned to ‘bones’ (matrices) and matrices are stored with the rotation, translation, and scaling for each individual frame of animation. With skeletal animation you can also do physics on the bones enhancing realism.
[/quote]
you only interpolate translation/rotation of each individual object of your full model

For morphing animation as you want to do, I also think that interpolate vertex is the best way if you do not have a huge amount of vertex (<10000 should works nice) and if you let the videocard recompute normal.

What do you mean with changing polygons? This is imho the wrong way to do it. You should have some kind of scenegraph which represents the scene and splits complex things into primitve things. If you want to animate something you dont even touch the polygons- you take the matrix which stores the transformation of your primitve shape and interpolate (maybe using slerp) to the target matrix. If you want to animate only one ear you use the matrix connected to this ear, if you want to animate the whole head you use the head matrix (because you use the head matrix everything on the head performs the same transformations the head performs).

if you want to morph an object ? eg.: a cube becoming a sphere

Sorry seems that I misunderstood some things :wink:
If he wants to morph (I just thought he only wanted to do some simple keyframe anims without morphing) he must touch the vertices. The way I described only works for non- morph animations.
But do you really wnat to start with morphing? Thats imho a lot harder to do than normal animations, you have to take care about where the vertices are located and the amount of vertices per geometry.

[quote]For skeletal animation vertices are assigned to ‘bones’ (matrices) and matrices are stored with the rotation, translation, and scaling for each individual frame of animation. With skeletal animation you can also do physics on the bones enhancing realism.
[/quote]
Does anyone have an exemple of skeletal animation using JOGL? or C++?