Matrix Bones
I''d read somewhere that bones are represent by matrix.. but now, if i have start and end point of a bone, how can i represent it like a matrix ??
I want to moltiply the bone matrix to a vector vertex to move this vertex in the space.. how can i do it ?
Is there, per chance, any mention of matrix stacks in the article that you have read?
Ok, sorry, matrix stacks aren't required at all for what you want (though they are related).
You want a matrix transformation such that the "bone" at the position (0,0,0) - (0,1,0) (for instance), is moved to the position (startpoint) - (endpoint). Once you have such a transformation, you can apply it to any point, and it will be transformed to the "bone space".
The transformation that you are looking for is simply a composition of a scaling transformation, a rotation transformation, and a translation transformation. Depending on the graphic package that you are using, building the matrices to do these transformation might be very easy.
- The scaling factor is simply the length of the vector (endpoint - startpoint)
- The rotation angle is the angle between the vector (endpoint - startpoint) and the vector (0,1,0). The axis is the crossproduct of these two vectors.
- The translation vector is simply (startpoint)
I hope that this is clear...
Cédric
[edited by - cedricl on July 6, 2003 11:38:11 AM]
You want a matrix transformation such that the "bone" at the position (0,0,0) - (0,1,0) (for instance), is moved to the position (startpoint) - (endpoint). Once you have such a transformation, you can apply it to any point, and it will be transformed to the "bone space".
The transformation that you are looking for is simply a composition of a scaling transformation, a rotation transformation, and a translation transformation. Depending on the graphic package that you are using, building the matrices to do these transformation might be very easy.
- The scaling factor is simply the length of the vector (endpoint - startpoint)
- The rotation angle is the angle between the vector (endpoint - startpoint) and the vector (0,1,0). The axis is the crossproduct of these two vectors.
- The translation vector is simply (startpoint)
I hope that this is clear...
Cédric
[edited by - cedricl on July 6, 2003 11:38:11 AM]
If you don''t know enough about matrices, ask python_regious about his tutorial

This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement