Ninja Library - Matrix Function

njScale

Scales a matrix

FORMAT

void njScale(*m, x, y, z)
NJS_MATRIX *m
Float x
Float y
Float z

PARAMETER

 *m  Calculation matrix 
 x  Scaling ratio along the X axis 
 y  Scaling ratio along the Y axis 
 z  Scaling ratio along the Z axis 

RETURN

None

DESCRIPTION

Scales arbitrary matrix m. When parameter m is NULL, the current matrix is scaled.

EXAMPLE

The following scales the current matrix by 0.5 along the X axis, 
1 along the Y axis, and 2 along the Z axis.

NJS_MATRIX stack[10];
NJS_VIEW view;
njInitMatrix(stack, 10);
njInitView(&view);
njSetView(&view);
njClearMatrix();
njPushMatrix(NULL);
njScale(NULL, 0.5f, 1.f, 2.f);
njPopMatrix(1);

NOTE

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

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