Sign in to follow this  
racarate

Beginner Skeletal Animation Question

Recommended Posts

I've only used openFrameworks to play back animations stored in .fbx files, but I want to get into it myself.  The first thing I want to try out is eye and head tracking on my skeletons.  I am having a bear of a time finding a tutorial or anything for this though.  All the skeletal animation tutorials I have found are about how to play back canned animations, but I want it to be a little more procedural.  Does anybody have a good reference?

Share this post


Link to post
Share on other sites

First, let me start off by saying... if you are just starting off with skeletal animation, as seen in the title... the LAST thing you'd want to do is implement head and eye tracking. Those two systems are part of a more advanced and relatively math heavy system known as inverse kinematics.

 

But, if you really feel like doing so, I recommend taking a look at the afore mentioned Inverse Kinematics. IK is not quite the complete opposite of forward kinematics (playback of canned animations). So... while yes, instead of starting at the root and animating the transforms down a graph, you are doing so in the inverse direction. The key difference here is that IK's properties allows you to re-position bones starting from the child node, and going up the tree.

 

Here are a few resources to an Inverse Kinematic system that Unreal uses (and proven to be incredible.) I also have a basic implementation of FABRIK... and I can tell you that it is pretty easy to implement. But only if you have a decent and working skeleton system in your engine, and you know how skeletal animation works on an intermediate level.

 

https://www.youtube.com/watch?v=tN6RQ4yrNPU

 

http://www.andreasaristidou.com/FABRIK.html

 

https://www.academia.edu/9165835/FABRIK_A_fast_iterative_solver_for_the_Inverse_Kinematics_problem

 

 

Still trying to work out constraints however, later project. The code to check against it is the easy part according to the algorithm. It's defining the allowed area that will be tricky. The algorithm uses conics to define its motion, which means you need to have an idea of the length of the bone before you can really do anything with it.

 

Though... you COULD try using a sphere... whoms radius is only as large as the bone it's self. You'd then use 3D bezier splines to define the maximum bounds.

Edited by Tangletail

Share this post


Link to post
Share on other sites

Haha, well crap.  I was hoping my simple eye- head- tracking would be simpler than canned playback.  In fact, I was about to just export my animations as .obj sequences and try to brute force pivot the vertices in proximity to a dummy object.

 

So.... yes it appears I have a lot of reading to do.  Thanks for the link though, I appreciate it.

Share this post


Link to post
Share on other sites

Yeah... I have no clue where you got the idea that canned animations were harder than something procedural. Canned animations are actually a crap ton easier. It's really you transform from point a to b per frame. Easiest method...

Think of this. Your bones are basically a graph. A scene graph in fact. Each child bone needs the location of it's root before it can proceed as planned. Your root is the universe to them. So you start there. You're trying to get to point A as smoothly as possible. Most game animations are just 15-20 frames per second. Your update is likely going to be 60hz, if not faster or slower.

You are interpolating with a LERP function to make a wild guess what the state might be like at that time. You aren't moving it over time. You are just re positioning per frame. Once that is done. Multiply the bones matrix to the children, and repeat the process for each child down the length. When that child bone is done, it multiplies it's matrix to the next child. And so on.

 

Believe it or not, with this concept in mind, it's actually faster to write your animation code, than it would be to get to the "Draw a triangle" stage in a Directx tutorial.

Edited by Tangletail

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