How to animate meshes in games

Started by
1 comment, last by Endar 18 years, 3 months ago
Hi, I would just like to ask how do you animate meshes in games? One method I'm familiar with is the traditional 2-D setup where you save each frames of the model doing an animation and just play it over a period of time, though I haven't actually implemented it yet. I also noticed that there's another method that saves more memory than the 2-D approach but is harder to implement. This is what I would like to know. Can you guys give me an overview of how to do this method and what it is called? Thanks.
Advertisement
There are quite a few ways of doing animation in 3D:
1. Store each frame in memory.
2. Store keyframes in memory and interpolate based upon time
3. Store one mesh and skeleton in memory and store keyframes of the skeleton to be interpolated
4. Add extra logic to 4 so the skeleton can respond to realtime events (ragdoll, physics)
5. Mix one of the above with texture animation.
6. ...

And for fun:

Try to implement it on the GPU...

Cheers
I assume that since you're talking about meshes that you mean in 3d? The first one you were talking about for 2d, saving each animation frame, the 3d version of that would probably be vertex keyframe animation. That's where you basically have a certain number of frames for the model, and each of those frames is a copy of the model is a certain position that is part of an animation.

And you want the approach that saves more memory but is harder to implement? That would be skeletal animation. That's where you have a copy of the model mesh, and there is also a series of joints (and maybe bones) that is called the skeleton. The keyframes for the animation are made by having copied of the skeleton in certain positions. Then, parts of the mesh are translated and rotated to match the translation and rotation of the part of the skeleton that they are associated with.

Do you know the theory of scene graphs? It's just like that except on the scale of a single model rather than the whole of the world space (of course it's different to implement).

Edit:: this gives a small intro into skeletal animation. here's another one, although it may be a little advanced for someone who's just starting out (I do actually refer that to myself as well right now :D ).
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper

This topic is closed to new replies.

Advertisement