Beginner Skeletal Animation Question

Started by
3 comments, last by Tangletail 8 years, 6 months ago

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?

Advertisement

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.

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.

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.

You don't need FABRIK for a LookAt IK, you simply have to change the rotation of one bone and then update recursively each child of this bone.

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.

This topic is closed to new replies.

Advertisement