ybenaabud

09-24-2008, 04:53 PM

Hello,

i am working on a 3D project. some where in my program i need to draw a plan that is perpendicular to a vector MB. for doing this i need to know the (x,y,z) of each voxel in this plan (a portion of the plan or window).

for this i need to make a marix that transform a well known vector MA (for exemple parallel to X axis) to a known vector MB of the same length. why ? because I will calculate the (x,y,z) of the plan perpendicular to X axis (witch is easy to calculate) and then multiplay by the matrix to obtain the (x,y,z) in the new plan (perpendicular to MB)

So i need a rotation matrix (because of the same origin M of the two vectors). I think i can do only two rotations (on Y and Z axis) to obtain the new vector MB.

In the literature I have only found rotation about x, y or z axis or even rotation about a vector v. but i can t find a matrix to have a vector from an other.

I don t know if i can consider the multiplication of two matrix (one alpha rotation about y and beta rotation about z) and try to find alpha and beta.

excuse me but i am not good at maths

think you

i am working on a 3D project. some where in my program i need to draw a plan that is perpendicular to a vector MB. for doing this i need to know the (x,y,z) of each voxel in this plan (a portion of the plan or window).

for this i need to make a marix that transform a well known vector MA (for exemple parallel to X axis) to a known vector MB of the same length. why ? because I will calculate the (x,y,z) of the plan perpendicular to X axis (witch is easy to calculate) and then multiplay by the matrix to obtain the (x,y,z) in the new plan (perpendicular to MB)

So i need a rotation matrix (because of the same origin M of the two vectors). I think i can do only two rotations (on Y and Z axis) to obtain the new vector MB.

In the literature I have only found rotation about x, y or z axis or even rotation about a vector v. but i can t find a matrix to have a vector from an other.

I don t know if i can consider the multiplication of two matrix (one alpha rotation about y and beta rotation about z) and try to find alpha and beta.

excuse me but i am not good at maths

think you