##### Ninja Library - Model Function

# njControl3D

Controls drawing of models and objects

### FORMAT

`

  void njControl3D( flag )
  Uint32 flag

`

### PARAMETER

  `flag` | Control parameter

### RETURN

  None

### DESCRIPTION

  Controls drawing of models and objects. Control parameters can be used in mutually consistent conbinations by using the "|" character as a delimiter.

  0 | Nothing is specified (default)
  NJD_CONTROL_3D_DISP_AXIS | Axis length 1 to the source of each model is drawn. (X axis, blue; Y axis, green; Z axis, red)
  NJD_CONTROL_3D_NO_CLIP_CHECK | Clipping check when drawing model ignored.
  NJD_CONTROL_3D_CONSTANT_ATTR | Model attributes changed. Parameters to be changed specified using njSetConstantAttr(). Cannot be set at the same time as NJD_CONTROL_3D_CNK_CONSTANT_ATTR.
  NJD_CONTROL_3D_CONSTANT_MATERIAL | Model material data changed to a fixed value. Parameters to be changed specified using njSetConstantMaterial().
  NJD_CONTROL_3D_OFFSET_MATERIAL | Model material data corrected. Parameters to be corrected specified using njSetConstantMaterial().
  NJD_CONTROL_3D_DEPTH_QUEUE | Depth queue activated. Depth queue parameters specified using njSetDepthQueue().
  NJD_CONTROL_3D_VERTEX_OFFSET | Vertex data moved in the normal line direction. Amount of movement specified using the _nj_vertex_offset_ parameter.
  NJD_CONTROL_3D_MODEL_CLIP | Makes model unit clipping effective.
  NJD_CONTROL_3D_CONSTANT_TEXTURE_MATERIAL | Texture material changed to white. Normal material color default setting.
  NJD_CONTROL_3D_SHADOW | Model drawing changed to cheap shadow mode.
  NJD_CONTROL_3D_SHADOW_OPAQUE | Sets model drawing to cheap shadow mode. (Shadows are not applied to translucent polygons.)
  NJD_CONTROL_3D_CNK_CONSTANT_ATTR | Attributes of the CHUNK model can be changed. Parameters to be changed specified using njSetConstantAttr(). Cannot be set at the same time as NJD_CONTROL_3D_CONSTANT_ATTR.
  NJD_CONTROL_3D_TRANS_MODIFIER | Allows modifier volumes to affect translucent polygons. If this setting is not made, modifiers have no effect on translucent polygons. If this setting is made, a translucent modifier buffer must be allocated.

### EXAMPLE

      sbInitSystem( NJD_RESOLUTION_640x240_NTSCNI, NJD_FRAMEBUFFER_MODE_RGB565, 1 );
      njInitVertexBuffer( 500000, 0, 10000, 0, 0 );
      njInitMatrix( matrix, 128, 0);
      njInit3D( vbuf, 4096 );
      njInitView( &view );
      njCreateLight( &light, NJD_DIR_LIGHT );
      njSetView( &view );
      njControl3D( NJD_CONTROL_3D_NO_CLIP_CHECK | NJD_CONTROL_3D_DISP_AXIS );
      while(1) {
       njClearMatrix();
       njTranslate( NULL, 0.f, 0.f, -10.f );
       njRotateXYZ( NULL, xx,yy,zz );
       njDrawObject( object );
       xx += 257;
       yy += 179;
       zz += 193;
       njWaitVSync();
      }

### NOTE

  In the case of a model drawing entirely within the screen, drawing performance can be improved according to this specification.

  Depth queue enables changing the transparency (alfa value) according to the distance.

### REFERENCE

  `njInit3D()
  njDrawModel()
  njDrawObject()
  njSetConstantAttr()
  njSetConstantMaterial()
  njSetDepthQueue()
  njSetCheapShadowMode()
  njCnkModDrawObject()
  njCnkModDrawModel()
  `

njControl3D

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999