two question about skeletal animation

Started by
2 comments, last by coollofty 19 years, 3 months ago
I export skeletal animation from 3dsmax with IGameExporter library. But my exported skeletal data from maxbone are always right, and from biped bone ara always error. I think my skeletal animation code has some problems, because I don't understand skeletal animation at all. So, the two questions are: 1. The matrix get from IGameSkin::GetInitSkinTM interface can do what? 2. I think, the bone init matrix get from IGameSkin::GetInitBoneTM interface, is a world matrix, the bone world matrix, so, invert this matrix and multiply to skinned vertices can transformed vertices to bone space, then use the bone node matrix to multiply all these vertices, should a good way to complete skeletal animation. But, it is works fine in maxbone, the biped bone always error. Why? THX.
Advertisement
"and from biped bone are always error"... what error? That's not very specific.

If I had to take a wild, shot-in-the-dark total guess, I would be that you're importing your bone hierarchy wrong.
My guess is that bones from biped don't have normalized weights, so you might have to normalize all the weights for a single vertex to add to 1.0 yourself in the exporter. I only use the Skin modifier, though, so I'm not sure whether this is the case.

The InitTM is the pose of the skinned things at the time when the modifier was inited (which means skeleton attached to skin). You can use this to calculate the "zero twist" or "identity" pose, i e, what would the mesh look like when all the bones are in identity orientation.

Are you using scale in your animations, or scale in your bones? That's something that often don't work well with skeletal animation; especially trying to calculate the identity pose; the reason is that the actual vert you get is already a blend of matrices with different scaling, so finding an inverse that will transform this vertex "back" to identity pose is tricky.
enum Bool { True, False, FileNotFound };
Thanks for replys, I think I have a little understand, so I write my second skeletal animation code, like the under:

BoneTM = BoneSpaceTM * ParentTM
FinallyTM = BoneInitTM * BoneTM

relative to a child bone, the "ParentTM" is his parent "BoneTM".

and the BoneInitTM is :
BoneInitTM = InitSkinTM * Inverse(InitBoneTM)

note the "InitSkinTM" and "InitBoneTM" are all get from IGameSkin class.

////////
OK, the "FinallyTM" is the vertices skinning matrix. and all the vertices is in object space.

Is this method right? Or if it imperfect, please point out. THX:)

This topic is closed to new replies.

Advertisement