20 Managing Quaternions

20 Q3Quaternion_Multiply

You can use the 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 of q1 and q2.

DESCRIPTION


The 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.

DESCRIPTION

3D Graphics Programming with QuickDraw 3D - 17 OCT 1995

© Apple Computer, Inc.

Let us know what you think of these prototype pages.

Generated with Harlequin WebMaker