Jump to content
  • Advertisement
Sign in to follow this  

transformation a vertex to a different coordinate system

This topic is 4883 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, I have posted this elsewhere but I still have not recieved a good enough response to fix the problem. I have my mesh vertices in world space, I need them in there parent's bone space. How do I do this? I tried just find the position of the bone/joint and then finding distance from the vertex, yet because the bones are not just translated but rotated that means the coordinate system for the bone has also been rotated and I don't know the math to fix this. Please help. Thanks in advance -THACO

Share this post


Link to post
Share on other sites
Advertisement
It's actually simple: to transform from world to bone space you need to use inverse of matrix you use to transform from bone to world (i guess you already have this matrix).

Share this post


Link to post
Share on other sites
Ok, I sorta tried this before, maybeI wasn't doing it correctly. Is this how it should be done?
Just multiply each vertex by the inverse of its parent? Now vertex = bone space?
Now when I want to render I just multiply the vertex by actual matrix of its parent at Time T?
I am using a vertex array in OpenGL so in the end I have to change it back to world space so that is why when I render I should multiple it back by the actual matrix of the bone?
Actually I think I am really dumb because this was the first thing I tried, yet later on while trying other things I relized my matrix * vertex(vector) function was screwed up (because in school i was taught the matrix translations were on the right side, not the bottom side) I don't think I went back and tried the inverse again.
I will post again when I try it again
Thank you so much hopefully this will work, I have been stuck on this for so long.

-THACO

Share this post


Link to post
Share on other sites
Well its official I am an idiot!
That worked, I knew it was a stupid thing.
Thank you so much for reminding me about the inverse and telling me about it.
It took me all of 30 seconds to fix. You are awsome! if you keep a tally of all the people you have helped you can put another notch up there.

-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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!