Archived

This topic is now archived and is closed to further replies.

ludo8x

Matrix Bones

Recommended Posts

ludo8x    122
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 ?

Share this post


Link to post
Share on other sites
Cedric    158
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]

Share this post


Link to post
Share on other sites
Cedric    158
In the articles & resources section. Alternately, you could make a member search for python_regious and look at his "Contributions" section.

Share this post


Link to post
Share on other sites