Sign in to follow this  
Funkymunky

Skeletons

Recommended Posts

Hi. I am interested in Skeletal animation, although I don't know if I want to load in any complex pre-defined skeletal system. I think I want to just do something simple of my own. I could load an MD3 model and apply my own skeleton to it, i guess. My ultimate goal is a ragdoll physics type deal, where I can control the skeleton by means of applying specific vectors to it. Anyway, does anybody have any advice about getting started on an app like this? What to read? How to go about it? Should I just start building a system of joints and bones?

Share this post


Link to post
Share on other sites
The trick if you don't want to get skeleton and skin from a file would be to bind vertices to bones and assign weights. Doing that manually isn't really an option and any kind of automatically doing it would lack flexibility (like binding all vertices to only one bone and pick the closest one).

But just to get it working I would ignore the "skin". In the end you have two basic approaches to store the skeleton. You can store absolute positions, but might have to store a full tree structure (ie. pointers or indices to childs to apply a transformation to a bone AND all child bones). Or you store it relative to the parent bone and just iterate over the whole skeleton once to calculate all the final results.

That's where you should decide how to connect bones and vertices. You can use the model "as is" with all vertices in their bind pose, but then you will also need to keep the inverse of the bind pose skeleton around (ie. you need to apply the difference of the current pose and the bind pose). The other option is to store all vertices relative to their bones in the first place, but that obviously means a set of coordinates for every bone a vertex is bound to. Not a problem if it's just one in most cases. Else I would prefer to store more data for the skeleton (inverse bind pose), so all bones are implicitely transforming a vertex to their own space before applying the transformation (that also means you can interpolate and sum transformations and only apply them once).

Only conceptual advice: when you see bones visualized in apps they always have a certain lengths which might tempt you store a length for them. But strictly speaking you only care about the joints and their position. The bone as such is then simply the connection from the parents position to the joints position. In other words, your system doesn't really need to know anything but joints.

Share this post


Link to post
Share on other sites

I think the best thing you could do is check out the milkshape tutorial on RealSoonNow. It's very simple, and milkshape is very cheap to get you started. Because as state above, assigning bone data to verticies by hand is not a smart option. Milkshape is very straight forward, cheap, and flexible. You can create your own importer and exporters, along with many pre-can'ed ones for you favorite model types.

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