Jump to content

  • Log In with Google      Sign In   
  • Create Account


Xerios

Member Since 04 Dec 2009
Offline Last Active Mar 10 2012 07:20 PM

Topics I've Started

Animation, bones, matrices,.. skeleton, how does it work ?

01 December 2010 - 11:11 AM

Well I got this weird annoying problem, which is probably because of my lack of full understanding of skeletal animation.

I wrote this Ogre3D's xml mesh importer which works as it should, all the data is imported correctly and linked ( bone children / vertex indices )

So far the files are parsed correctly, the model is rendered and everything is where it should be.

Now the problem is how to use that animation data, the skinning is not a problem but the matrices that need to be sent to the shader are.

No matter what I tried, I always ended up with a weird animation that made my models look like some bunch of mutated cripples. I have tried different ways to do this but I kept failing, I even failed making it draw a proper bone structure using bunch of lines.


I am using SlimDX ( if that changes anything ) and I would really appreciate if some one could help me on this one. Maybe it's something that I'm doing wrong, or maybe Ogre3D's skeleton format has some values that need to be converted. I just don't really know =(

Here's my incorrect code for drawing the basic skeleton :

public void RenderBones(Bone root) {
root.fullMatrix= root.initialMatrix;
if (root.parent!=null) {
root.fullMatrix *= root.parent.fullMatrix;
RenderLine(root.parent.fullMatrix,root.fullMatrix);
}

foreach (Bone bone in root.children) RenderBones(bone);
}


I spent days trying to figure out how to do this properly, so asking for help is now my final solution =)

[Edited by - jpetrie on December 1, 2010 6:58:38 PM]

PARTNERS