Archived

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

walkingcarcass

Rotation matrix

Recommended Posts

I like the quaternion way of rotate-by-angle-about-axis, but the quat->matrix is ugly. Is there a simpler way to build a matrix which rotates by theta about V? BTW, when looking down the vector, the rotation is counter-clockwise, right? ******** A Problem Worthy of Attack Proves It''s Worth by Fighting Back

Share this post


Link to post
Share on other sites
could you please tel me how kdogg, i cant figure out on my own...

walkingcarcass: check out the last tutorial on this site about quaternions. it should answer all your questions.

Share this post


Link to post
Share on other sites
To rotate a vector v, represent v as [0, v]. Where q is the rotation quaternion:

Rot(v) = q * v * q-1


multiplication of quaternions:

[s1,v1]*[s2,v2] = [s1*s2 - v1[dot]v2, s1*v2 + s2*v1 + v1[cross]v2]

inverse of a quaternion:

q-1 = (1/||q||)2*[s,-v]

Share this post


Link to post
Share on other sites