Rotation matrix
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
You can just use your quaternions to rotate your vertices directly without using a 4x4 matrix at all.
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.
walkingcarcass: check out the last tutorial on this site about quaternions. it should answer all your questions.
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]
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement