Ninja Library - Matrix Function

njRotateXYZ

Applies a matrix that gives rotation around X, Y, and Z axes

FORMAT

void njRotateXYZ( *m, x, y, z )
NJS_MATRIX *m
Angle x
Angle y
Angle z

PARAMETER

 *m  Destination matrix 
 x  X axis rotation angle 
 y  Y axis rotation angle 
 z  Z axis rotation angle 

RETURN

None

DESCRIPTION

Applay a matrix that gives rotation around the X, Y, and Z axes to the matrix m, in that order. When parameter m is NULL, the current matrix will be the destination.

EXAMPLE

The following applies a matrix that gives rotation of 30 degrees around the X axis, 
60 degrees around the Y axis and 90 degrees around the Z axis to the current matrix.

NJS_MATRIX stack[10];
NJS_VIEW view;
njInitMatrix(stack, 10);
njInitView(&view);
njSetView(&view);
njClearMatrix();
njPushMatrix(NULL);
njRotateXYZ(NULL, NJM_DEG_ANG(30), NJM_DEG_ANG(60), NJM_DEG_ANG(90));
njPopMatrix(1);

NOTE

For a matrix [M] and multiplicative rotational matrix [R], [M] = [R] * [M]. Care must be taken with the order in which matrices are multiplied.

njRotateXYZ
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999