Page 1 of 1

World space to local space

Posted: Tue Oct 20, 2009 9:22 am
by charles88
Hi, could anyone help me with .x model(dwarf.x)? basically, I want to get back the local matrix of the .x model after I load it into the engine. But I failed after many attempts. Can someone help me please?

Thank you.

Posted: Tue Oct 20, 2009 5:09 pm
by vitek
The model itself doesn't have a transformation matrix. The scene node has a transformation matrix, that you can access with getTransformation() and getAbsoluteTransformation() (they are different). Each of the joints have their own transformations that you can access by asking the IAnimatedMeshSceneNode for its joints.

Travis

Posted: Wed Oct 21, 2009 3:24 pm
by charles88
Thanks for your reply. So first I should get the joints' transformation, then get the vertices around the joints and transform it back to local space?

I will try to do as you said, and post my solution if I found one. :)

Posted: Wed Oct 21, 2009 4:23 pm
by vitek
I don't know what you're trying to do. You said you wanted to get the local matrix of the .x model and I gave you the information you needed. Now you are assuming that I know what you want to do with the transform. How about you just stop for a few seconds and tell us what you want to achieve, and then maybe we can help you.

Travis

Posted: Thu Oct 22, 2009 1:34 am
by charles88
oh... sorry, basically I want to get back the vertices of the .x file and write it back to a new .x file after changing the vertices.

Thx. :)