Jump to content
  • Advertisement
Sign in to follow this  
KuroKage

How to animate meshes in games

This topic is 4580 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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 ).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!