Ninja Library - View Function

njRotateViewXYZRelative

Rotates the view location around the X, Y, and Z axes (relative rotation)

FORMAT

void njRotateViewXYZRelative( *v, angx, angy, angz )
NJS_VIEW *v
Angle angx
Angle angy
Angle angz

PARAMETER

 *v  Pointer to view structure 
 angx  X axis rotation angle (relative amount) 
 angy  Y axis rotation angle (relative amount) 
 angz  Z axis rotation angle (relative amount) 

RETURN

None

DESCRIPTION

Rotates the view by a relative amount around the X, Y, and Z axes. Rotation proceeds in the order of X axis, Y axis, and Z axis.

EXAMPLE

The following rotates the view located at (0, 0, 3000) 
and directed towarded (0, 0, -1) (into the screen) by 30 degrees around the X axis, 
60 degrees around the Y axis and 90 degrees around the Z axis,
without changing the view location.

#define VIEW_PX 0.f
#define VIEW_PY 0.f
#define VIEW_PZ 3000.f
#define VIEW_VX 0.f
#define VIEW_VY 0.f
#define VIEW_VZ -1.f
#define VIEW_ROLL 0
NJS_VIEW v;
v.px = VIEW_PX;
v.py = VIEW_PY;
v.pz = VIEW_PZ;
v.vx = VIEW_VX;
v.vy = VIEW_VY;
v.vz = VIEW_VZ;
v.roll = NJM_DEG_ANG(VIEW_ROLL);
njRotateViewXYZRelative(&v, NJM_DEG_ANG(30), NJM_DEG_ANG(60), NJM_DEG_ANG(90));
njSetView( &v );

NOTE

When parameter v is NULL, the current matrix is rotated.

REFERENCE

njSetView()

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