njLookAtView Japanese
<-|INDEX|->
Changes the view direction towards point (x, y, z).

FORMAT

#include <Ninja.h>

void njLookAtView( *v,  x,  y,  z)
NJS_VIEW *v
Float x
Float y
Float z

PARAMETERS

*v
view structure pointer
x
X coordinate of point toward which view is being directed
y
Y coordinate of point toward which view is being directed
z
Z coordinate of point toward which view is being directed

RETURN VALUE

None

FUNCTION

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;

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);

njLookAtView(&v, 0.f, 0.f, 0.f);
njSetView(&v);
njClearMatrix();

NOTES

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

RELATED TOPICS

njInitView()
njSetView()
njClearMatrix()

njLookAtView
<-|INDEX|->

Copyright SEGA ENTERPRISES, LTD., 1997