[Algorithms] Scaled quaternion rotations (was: Representing AnimationKey Frame with Quaternion+Tran
Brought to you by:
vexxed72
From: Marc B. R. <mar...@or...> - 2008-06-24 11:14:36
|
Cayley in [1,2] demonstrates general 3D rotations via quaternions, (left-handed and right-handed respectively). >From [2]: P' = Q P (1/Q) (e.1) Notice that if you multiply Q by an non-zero scale factor 's', you get: P' = (sQ) P (1/(sQ)) = (s/s) Q P (1/Q) = Q P (1/Q) So if we consider some quaternion Q to respresent a rotation using (e.1), all scalar multiples of Q represent the same rotation. If we additionally consider Q to be a point in some 4D space, then the point is homogenous and (since we've dropped one degree of freedom) is a 3D object embedded in the 4D space. The set of all quaternions which represent the same rotation may be described as 'sQ', again for all 's' except zero and is a line through the space. Unit quaterions come into play since the inverse can be replaced by the conjugate, which has nice algebraic, numeric and computation properties. So if U is a unit quaternion we can instead use the following: R' = U R U* (e.2) The set of all unit quaternions is a sphere and the line of all quaternions which represent a given rotation intersects the sphere at two points (thus the double coverage). Continuing to use (e.2), let's plug in a non unit quaternion: Q=sU R'' = Q R Q* = (sU) R (sU)* = (s^2) U P U* = (s^2) R' So R'' is R' scaled by a factor of (s^2). Composition of rotations is achieved by the product: C = A B Multiply 'A' and 'B' by non-zero scales 'a' and 'b' respectively: C = (aA)(bB) = (ab)AB Combining all of the above, to effect a scaled rotation, use a quaternion which has a magnitude of the square-root of the desired scaled factor in (e.2). ---- [ 1] "On certain results concerning quaternions", Arthur Cayley, 1845 [ 2] "On the Application of Quaternions to the Theory of Rotation", Arthur Cayley,1848 |