Sign in to follow this  

Skeletal animation equation

This topic is 2851 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

Many people think that skeletal animation is just: Equation 1 but it seems there more going on there than this equation actually shows. Refering to collada's reference the equation for skeletal animation is: Equation 2 bindShapeMatrix is fixed, and should multiply all vertices once at initialization. invBindMatrix takes v from object space to jointspace. jointMatrix takes v from jointspace back to object space. Also jointMatrix is calculated hierarchically(by starting at the root of the skeleton, and so on) every time the animation is updated. Now it is obvious what i can do here: precalculate for all frames the following product: Equation 3 and by Equation 2 becomes exactly as Equation 1. But precalculating all this data for all the frames eats up a lot of memory! The animation data for a model who's static data takes about 0.5 mb is over 18MB in size!!! So how should i do it then? Having just on matrix to send to the vertex shader is obviously better then sending two!(invBindMatrix and jointMatrix). Also precalculating all the keyframes for the skeletal animation(i'm not talking about vertex tweening animation here) take a lot of memory so it's not feasible.

Share this post


Link to post
Share on other sites
You could save some space using quaternions for rotation, and possibly only a couple of translation terms - scale and complicated translation are often not required in skeletal animation - This might save you both data size and computation time.

Alex

Share this post


Link to post
Share on other sites
Quote:
Original post by aleks_1661
You could save some space using quaternions for rotation, and possibly only a couple of translation terms - scale and complicated translation are often not required in skeletal animation - This might save you both data size and computation time.

Alex


Thanks Alex, i already use quaternions! As for the translation and scale i use full 3D vectors. Due to the fact that i precompute the translation and scale i need to store full 3d vectors, so no memory win here..

Share this post


Link to post
Share on other sites
You could have a look at the archives of the SWEng-Gamedev mailing list, there have been a good few threads on there about animation, usually with some comments about hot it is done in Granny, which seems to be a pretty comprehensive package.

Alex

Share this post


Link to post
Share on other sites
Normally the jointMatrix is calculated dynamically during execution when the animation time is advanced. Only bindShape*v is precalculated. invBind is stored in an array (size=number of joints).

At each time advance:

Calculate jointMatrix (the animation matrix) for each joint.
Calculate jointMatrix*invBindMatrix (jointTransform above) and store in an array (size=number of joints) (and set in a shader array if you're using a shader)
Calculate v' (commonly in a shader)
Render.

Share this post


Link to post
Share on other sites
Quote:
Original post by Buckeye
Normally the jointMatrix is calculated dynamically during execution when the animation time is advanced. Only bindShape*v is precalculated. invBind is stored in an array (size=number of joints).

At each time advance:

Calculate jointMatrix (the animation matrix) for each joint.
Calculate jointMatrix*invBindMatrix (jointTransform above) and store in an array (size=number of joints) (and set in a shader array if you're using a shader)
Calculate v' (commonly in a shader)
Render.


Okay, i understand now. By calculating the joint matrix at small intervals you get smooth blended vertex positions!

Share this post


Link to post
Share on other sites

This topic is 2851 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.

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