Jump to content
  • Advertisement
Sign in to follow this  
THACO

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!