there are a few basic ways to do character animation…
Going from the easiest to impliment up to the best looking…
No1. Swap The Models
load up each frame of each animation cycle and swap the models each time you get to the next keyframe. The problem with this is that it is inefficient to store 100+ copies of the same data in different locations. It will also give very jerky animation (only swapping models…)
If you think about it though (presuming you dont use display lists for animating objects - YOU SHOULDN’T BE!!!) the only thing that changes between poses is the vertex and normal data. For each keyframe, load up only vertices and normals, You can then simply replace the data in your model with these positions…
No2. Shape interpolation (blendshaping or morphing )
Load up one copy of the texturing coords, colours, and face info. Calculate the vertices and normals by blending between those held in the various animation frames.
ie, to move from frame 1 to frame 2, for each x,y,&z coord of each normal & vertex, perform the following calculation
VertexFinal.x = (1-t)Frame1.x + tFrame2.x
VertexFinal.y = (1-t)Frame1.y + tFrame2.y
VertexFinal.z = (1-t)Frame1.z + tFrame2.z
where t is a time value that varies from 0 to 1. You’d have to work out a relative time value between each frame.
Basically the effect will be morphing between keyframes, it does however still require a hell of a lot of memory, and at certain points the model may go out of shape and look wrong.
No3. Hierarchy of geometry
set up a hierarchy and transform solid geometry by the rotations of the parent geometry, think Quake 2 and older 3D games.
With this, you need only store the geometry once , a bunch of rotation values and the hierarchy itself . There are no unwanted ‘odd’ deforming effects, and memory requirements are low. It is also very fast.
No4. Skinned animation
Create a skeleton, load a mesh, load some vertex weights and set up a skinned animation model.
The visual quality of this is very high, the mesh appears to deform realistically, and the processing is a little bit faster than method No2.
This is not however, the easiest thing to impliment because you need to load a mesh, load up all the joint weighting, and then sort out all the processing that deforms each vertex.
Your best bet is No3, moving on to 4 in my opinion…
[This message has been edited by Rob The Bloke (edited 03-22-2001).]