Sign in to follow this  
zacaj

3D Animation System Design

Recommended Posts

I started implementing skeletal animation in my engine, and I think I have that part working, but Im running into trouble dealing with the structure and logic of the animation system itself. The few articles Ive seen on skeletal animation just deal with loading a few frames of an animation and drawing them, but nothing about storing the animations when you have multiple animations for your model or having different animations on different parts of the model, etc.

1. In most 3D modelers that Ive seen, theres just one animation track, which seems like it should only hold the data for one 'action' that a character would perform. Ive seen passing reference to people just storing text files with their models specifying a range of frames and a name, so you can 'play' the 'run' animation. This seems really annoying and messy though, and it feels like there must be a better accepted way to do it

2. Animating parts of the model. I read that quake 3 (?) could animate the top and bottom of their models separately so a person could be running and shooting without manually making all the animations. I assume modern engines can handle this, but also without any hard-coded limitations like this. I know most model formats seem to store data only for the joints that change at that keyframe, which would seemingly accomplish this, except theres no way to tell when the previous key frame is part of another animation (see #1).

3. When you render a model, you need the current transforms of every joint in the model, which seems like it could get really complex to be handling multiple animations running on different parts of the model at once, especially if some joints dont have any animations currently affecting them.

Share this post


Link to post
Share on other sites
2, 3. I don't have time to give you a proper reply, but I can give you some keywords to search for. 'animation blending' and 'animation layering' will get you started. There are quite a few very good discussions on the gamedev.net forums about these topics that will help you out. Look for posts by 'RobTheBloke' and 'haegarr' in particular.

Share this post


Link to post
Share on other sites
[quote name='zacaj' timestamp='1317934437' post='4869894']
1. In most 3D modelers that Ive seen, theres just one animation track, which seems like it should only hold the data for one 'action' that a character would perform. Ive seen passing reference to people just storing text files with their models specifying a range of frames and a name, so you can 'play' the 'run' animation. This seems really annoying and messy though, and it feels like there must be a better accepted way to do it[/quote]

it's fairly simple to lerp between animations (in local space though!). The difficulty comes in actually authoring a network of animations that can be blended together, because, as you note, most 3D packages have a single animation track. To this end, the quality of your toolset will have more of an impact on quality than your engine code. For some reason, people don't get too excited by writing tools, and so their animations can end up a bit flaky....

[quote name='zacaj' timestamp='1317934437' post='4869894']
2. Animating parts of the model. I read that quake 3 (?) could animate the top and bottom of their models separately so a person could be running and shooting without manually making all the animations. I assume modern engines can handle this, but also without any hard-coded limitations like this. I know most model formats seem to store data only for the joints that change at that keyframe, which would seemingly accomplish this, except theres no way to tell when the previous key frame is part of another animation (see #1).[/quote]

It's not that common to split the characters like that anymore. Typically you'd say that animation X, works on the bones contained in the set Y - but that would be blended with everything else. It's possible you may also assign weighting to each of those bones within a set (i.e. for an upper body animation, the lowest spine joint has a lower weighting that the highest joint in the spine. That should make the blend a little nicer at the join....). In general though, there are quite a few ways to solve this problem. Chances are you'll only be able to come up with very labour intensive, massive PITA of a system to work with. Sadly that design is probably about right.....

[quote name='zacaj' timestamp='1317934437' post='4869894']
3. When you render a model, you need the current transforms of every joint in the model, which seems like it could get really complex to be handling multiple animations running on different parts of the model at once, especially if some joints dont have any animations currently affecting them.
[/quote]

Yes. It's a very complex problem to solve.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this