# Matrix Math help

This topic is 5062 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
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

##### Share on other sites
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

##### Share on other sites
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

##### Share on other sites
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

1. 1
Rutin
31
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633313
• Total Posts
3011320
• ### Who's Online (See full list)

There are no registered users currently online

×