Does anyone know how are the transformations stored inside an XFile frame hierarcy, is each transform relative to it's parent, or are they in world space
Looking at the SkinnedMesh sample, you can see that the final bone transformation matrix is calculated as:
matFinalBone = matBoneOffset * matBoneWorld
So this offset matrix actually moves the vertices back to identity (I assume .X stores the mesh in its default pose) so they can be correctly transformed by the final (animated) bone matrix.
Thanx for the info. I have another question about transforms in X files. Do you maybe know what are the offset matrices in the SkinWeights template. I am writing an OGRE mesh to X converter, and I'm having trouble with these matrices (bones in my meshes are not transformed correctly), for now, i just set them to inverse bone frame matrices (i read that somewhere), but I think that is wrong.
Nested transformation frames are relative to each other. That is:
Frame0
{
Frame1
{
}
Frame2
{
}
}
Frame1 and Frame2 are children of Frame0, and all meshes contained within these two children frames should be transformed using the world matrix built from the concatenated Frame0 and Frame1/2 matrices...
The point is that this matrix resets the vertices from neutral pose (e.g. the character standing with its arms open wide up) to the space where the bone's animated matrices are specified (so yes, it is actually what you described )...
Thank you very much for clearing that up for me. I'm working on an OGRE mesh to X converter, and after I convert skinned meshes, my transforms blow up, so I just wanted that cleared, so I can be sure that the my bug isn't in this part of the code. Once again, thanx!
XFiles & Transforms
biju7630
Waylander67
Looking at the SkinnedMesh sample, you can see that the final bone transformation matrix is calculated as:
matFinalBone = matBoneOffset * matBoneWorld
So this offset matrix actually moves the vertices back to identity (I assume .X stores the mesh in its default pose) so they can be correctly transformed by the final (animated) bone matrix.
Spence Gong
lcan
Nested transformation frames are relative to each other. That is:
Frame0
{
}
Frame1 and Frame2 are children of Frame0, and all meshes contained within these two children frames should be transformed using the world matrix built from the concatenated Frame0 and Frame1/2 matrices...
jonrmorgan99
Larry Foat