20 Managing Quaternions
Q3Quaternion_Multiply
function to multiply two quaternions.
TQ3Quaternion *Q3Quaternion_Multiply ( const TQ3Quaternion *q1, const TQ3Quaternion *q2, TQ3Quaternion *result);q1
A quaternion.q2
A quaternion.result
On exit, the product ofq1
andq2
.
Q3Quaternion_Multiply
function returns, as its function result and in the result
parameter, the product of the two quaternions q1
and q2
.
If you want to rotate an object by the quaternion qFirst
and then rotate the resulting object by the quaternion qSecond
, you can accomplish both rotations at once by applying the quaternion qResult
that is obtained as follows:
Q3Quaternion_Multiply(qSecond, qFirst, qResult);Note the order of the quaternion multiplicands.
Let us know what you think of these prototype pages.
Generated with Harlequin WebMaker