• Advertisement

Archived

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

Rotation matrix

This topic is 5409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
You can just use your quaternions to rotate your vertices directly without using a 4x4 matrix at all.

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
I already know quaternions. I want their equivalent matrix, not converting or substituting.

********


A Problem Worthy of Attack
Proves It''s Worth by Fighting Back

Share this post


Link to post
Share on other sites

  • Advertisement