2d Skeletal Animation system

Started by
1 comment, last by Sappharos 12 years, 3 months ago
Hi all!

I was wondering if anyone has every written a 2d skeleton-based animation system. I'm using joints, not bones, because I'll be needing only a few operations. Plus, it's easier to implement :D. Since I'm in the process of writing this system, any tips / code snippets / suggestions sure would be helpful :)

Also, I was wondering how physics would be handled in there circumstances. I'm using a physics engine as of now, so would I have to use a hitbox / create a physics shape for each joint? or would I need to use some other technique?

anway, thanks all!
~Bollµ

a WIP 2d game engine: https://code.google.com/p/modulusengine/

English is not my first language, so do feel free to correct me :)

Advertisement
I'm using joints, not bones, because I'll be needing only a few operations. Plus, it's easier to implement :D.

What do you mean?
3D skeletal animation also uses joints. Bones are the 'imaginary' things between a joint and its parent.
To implement skeletal animation in 2D is exactly the same as in 3D.
You could even use the same code (and ignore the Z coordinate), or you could implement it in true 2D (using 2D vectors and 3x3 matrices instead of 3D vectors and 4x4 matrices)
Check out this thread - I attempted a 2D skeletal animation a month or so ago. Here are videos of its progress at various stages, in order from earliest to latest:









The end result (as far as I got) was pretty pleasing, but if you look at the earlier videos it might be easier to see how it was structured. Basically I used sine waves to determine the current position of each joint, relative to its parent.

Eventually I lost motivation because I realised the easiest way to progress would be to start again with 3D vectors, even if they were drawn in 2D. Depending on how sophisticated your animation is you might want to do the same. Consider the order in which body parts are drawn, especially if there is a turning animation.

This topic is closed to new replies.

Advertisement