Skip to main content
GameDev.net gamedev.net
🔒 Locked

Matrix Math help

Started by THACO Jan 4, 2005 at 3:32 PM 3 replies 1.5k views
Original Post
THACO
THACO
Ok, so Im doing skeletal Animation. I have the rotations and trasformations of each bone in matrix form. I can animate the skeleton fine. The problem comes when i put on the faces of the mesh. First off to start, I have the information about the triangles in world space, not in the same space as its bone parent. So after I read in all the information from the file. I multiply each vertex by its parents inverse matrix at frame 0(does this mean the verteces are now are in respect to its parents bone??) So then when I want to display the Mesh I just multiply the specific vertex by its bone parents matrix at Time X. The only frame that actually looks good is frame 0, because I just end up multiplying the vertex by the inverse then back by regular matrix so they cancell each other out. What am I doing wrong?? -THACO
3dModelMan
3dModelMan
Sounds familiar :-) (see the "help with understanding ms3d" thread near by)

If frame 0 looks good then that's obviously a good thing. I suggest you look at how you are interpolating your keyframe postions and rotations over time.

- Matt

THACO
THACO
Ok my big problem is when I export my vertices, they are exported in world sapce or with reference to the origin in 3dsmax. I need to change those so they are with respect to its bones parent. How do I do this??

What I thought was that if i multiplied the vertex by the inverse of its parent bone, it would then move the vertex into the bone's space. Apparently this doesn't seem to be the case. Because when I try to animate and a bone moves, i multiply the vertex(which already was mult by frame 0 matrix) by a different frames matrix which then should then have the vertex in correct position in the world? (Im putting everything into a vertex array so i need to have vertex in respect to the world in the end)

When it comes to the bone and skeletal animation everything is good. The problem is with the vertices for the faces.

-THACO
ErikPersson
ErikPersson
To get your vertices into 'bone space'

create a translation matrix
BoneSpaceMatrix=TranslationMatrix(-BonePos.x,-BonePos.y,-BonePos.z);

I think that should do it
THACO
THACO
I can't just create a translation matrix becuase there are also rotations, the bones are created mainly through rotations then one translation which is just an extension to the next bone. So if i just translate it still looks funny. Im still having trouble.


-THACO

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.