Ninja Library - View Function

njLookAtViewV

Changes the view direction towards specified point

FORMAT

void njLookAtViewV( *v, *p )
NJS_VIEW *v
NJS_POINT3 *p

PARAMETER

 *v  Pointer to view structure  
 *p   Coordinates of point to which view is to be directed 

RETURN

None

DESCRIPTION

Changes the view direction towards a point (x, y, z).

EXAMPLE

The following changes the direction of the view located at (500, 500, 500) and directed toward (0, 0, -1) (to rear of screen) toward the origin (0, 0, 0).
#define VIEW_PX 500.f
#define VIEW_PY 500.f
#define VIEW_PZ 500.f
#define VIEW_VX 0.f
#define VIEW_VY 0.f
#define VIEW_VZ -1.f
#define VIEW_ROLL 0
NJS_VIEW v;
NJS_POINT3 p;
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);
p.x = 0.f;
p.y = 0.f;
p.z = 0.f;
njLookAtViewV(&v, &p);
njSetView( &v );
njClearMatrix();

NOTE

When parameter v is NULL, the current view is changed.

REFERENCE

njInitView()
njSetView()
njClearMatrix()

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