quaternion question
is there a way to multiply a vertex directly by a quaternion or do you have to convert it to a matrix first.
yes. there is. and it''s actually slightly more efficient than matrix multiplication. But, alas, I can''t tell you what it is off hand so I suggest you google it. Ie, quaternion vector multiplication.
you will probably find it in the matrix/quaternion faq
http://www.j3d.org/matrix_faq/matrfaq_latest.html
| - Project-X - my mega project.. big things comming soon - | - adDeath - an ad blocker I made - | - email me - |
you will probably find it in the matrix/quaternion faq
http://www.j3d.org/matrix_faq/matrfaq_latest.html
| - Project-X - my mega project.. big things comming soon - | - adDeath - an ad blocker I made - | - email me - |
does anyone have some example code? the matrix & quaternion faq said the equation was q*v*q[-1] but i''m not quite sure what this means. the -1 means invert the first 3 numbers in the quaternion right?
the -1 means the inverse of the quaternion and is not equal to inverting the first 3 numbers of the quaternion
basicly if q = [s,v] where s is a scalar and v a vector
then q^(-1) = (1/length(q))^2 * [s,-v]
and length(q) = sqrt(s*s + v.x*v.x + v.y*v.y + v.z*v.z)
Note you can ditch the sqrt and the ^2
To avoid confusion, by ^ I mean power of, not some bitwise operator.
[edited by - George2 on January 29, 2003 5:04:36 PM]
basicly if q = [s,v] where s is a scalar and v a vector
then q^(-1) = (1/length(q))^2 * [s,-v]
and length(q) = sqrt(s*s + v.x*v.x + v.y*v.y + v.z*v.z)
Note you can ditch the sqrt and the ^2
To avoid confusion, by ^ I mean power of, not some bitwise operator.
[edited by - George2 on January 29, 2003 5:04:36 PM]
"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement