Jump to content
  • Advertisement
Sign in to follow this  
SiddharthBhat

2d Skeletal Animation system

This topic is 2548 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 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µ

Share this post


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

Share this post


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

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!