Skeletal Animation (Rigging/Skinning)

Right now, I’m working on an animation system for the XNA, which I will release its first version tomorrow. The first version of this system will come with some basic features, such as animation playback, animation speed and loop control, animation interpolation control and others. Also, I’m planning to add many more cool features to it in the next weeks. Before I release the animation system I decided to post an introduction about skeletal animation. I hope you enjoy it! =)

In the skeletal animation, each model is composed by one or more meshes and a skeleton. The model’s skeleton is a hierarchy of bones, in a n-tree like form, where each bone has a local configuration.

Skeleton Diagram

You can see by the picture above that the model’s skeleton looks like a very simplified human skeleton. If you consider that a bone can be translated, rotated or even scaled, its local configuration will be the combination of all these transformations. Note that I’m using the term “local configuration” here because the bone’s configuration is relative to its parent. Thus, if we translate or rotate any bone in the hierarchy all its children will be affected.

Skeleton Diagram 2

Now you may ask: why I need this skeleton, how can I use it? Ok. Every vertex of the model’s mesh is linked to one or more skeleton’s bones. In this way, any transformation applied over a bone can deform a model’s mesh. Therefore, if you rotate a character’s forearm bone the forearm of the model’s mesh will be rotate too.

Interesting, isn’t it? Now you may ask: Where can I create a skeleton? How can I link it to a mesh? There a lot of Digital Content Creation (DCC) Tools available that can handle this task, such as: 3D Studio Max, Maya, SoftImage XSI, MilkShape 3D and many others. If you are working with the XNA I would recommend you use Maya, 3D Studio Max. Another good option is the MilkShape 3D which has low price. Below is a picture of the marine model used in the XNA TPS and its skeleton.

Mesh Skeleton

The last thing we need to learn is how to store and play animations using skeletal animation. We already know that the model’s mesh is deformed according to the model’s skeleton, and that each skeleton’s bone stores its configuration (translation + rotation + scale). In this case, an animation can be stored as an array containing the new bone configuration and the time to set this new configuration. Finally, you can play an animation traversing the new bone configuration array and modifying the configuration of the skeleton’s bones over the time.

Leave a Comment

*