Developing an Animation Library – XNAnimation 0.1

Last year, when I start to work on the XNA TPS game I spend some time studying computer animation, or to be more specific, skeletal animation (also known as skinning).

My duty was to implement an efficient and flexible way to animate the game characters using skeletal animation. While some actions like walking and running are simple to reproduce and can be pre-made in a modeling tool (such as Maya), other actions like aiming a target at any position might need some kind of procedural animation, or inverse kinematics (IK).

While developing the first prototype of the XNA TPS animation library I was very concerned about performance (yeah, it was a big mistake). Because of that, the animations were stored through time frames and poses, where each time frame stores a time and a pose, and each pose stores the configuration of all the skeleton’s bones. Moreover, I decided to bake all the bones, storing their absolute configuration instead of their local configuration. This system was indeed very fast: you can find a time frame in O(logN) using a binary search and then use it. However, it used a lot of memory and wasn’t flexible!

On the second prototype I was looking for different approaches to reproduce animations, such as splitting the animation in channels (where each bone has its own channel) or using a simpler and efficient approach like the XNA’s Skinned Model Sample. At that time I implemented something similar to the XNA’s sample (deadlines don’t leave me many options).

Some weeks ago I decided to put together what I’ve learned about animations in a skeletal animation library. Then, I come up with the XNAnimation, which is a skeletal animation library for the XNA. XNAnimation 0.1 is the first version of this library and there’s still a lot of work to be done. You can download it with samples at the Projects section.

Leave a Comment

*