Sign in to follow this  
GutenTag

Skeletal animation issues

Recommended Posts

Hi Everyone, I've been spending the past couple of days hammering away at getting skeletal animation imported from .dae files.

 

I have been following this tutorial which in all honesty has been a travesty to work though (poorly formatted code, confusing variable names, and a strange obsession with converting every math component in assimp to a glm equivalent)

Through it all, I seemed to have at least gotten a "desired" result, though that results is more apt to being called something straight out of David Cronenberg's house of horrors.

I have attached all the source (c++) files relevant to the animation system, I figure another experienced set of eyes will help point out what I've missed.

 

JPh6SJP.png

Share this post


Link to post
Share on other sites

The first step is to understand the data of a skinned mesh : the vertices are in world space.
Once you know that you understand to move from one world space to another world you have to do 2 operations : remove the actual world space and add the new world space.
To remove the actual world space you use the inverse of the bind pose matrix, bind pose matrix is the world space matrix of the bone.
When you apply this inverse bind pose matrix you end to local space, so then you simply have to use the new world space matrix.
The new world space matrix is the matrix computed for one animation at a time using interpolation on keyframes.
Each bones of your mesh contains a serie of keyframes.
It why the matrix of the bone is computed as :

InverseBoneBindPose * BoneAnimationWorldSpace

You can add your object world space in the calcule :

InverseBoneBindPose * BoneAnimationWorldSpace * ObjectWorldSpace
Edited by Alundra

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