transformation a vertex to a different coordinate system

Started by
2 comments, last by THACO 19 years, 3 months ago
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
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).
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
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

This topic is closed to new replies.

Advertisement