##### Ninja Library - View Function

# njLookAtView

Changes the view direction towards specified point

### FORMAT

`

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

`

### PARAMETER

  `*v` | Pointer to view structure
  `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

  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;
      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);
      njnjLookAtView(&v, 0.f, 0.f, 0.f);
      njSetView( &v );
      njClearMatrix();

### NOTE

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

### REFERENCE

  `njInitView()
  njSetView()
  njClearMatrix()
  `

njLookAtView

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999