##### Ninja Library - Model Function

# njCnkDrawObject

Draws chunk object

### FORMAT

`

  void njCnkDrawObject( *object )
  NJS_CNK_OBJECT *object

`

### PARAMETER

  `*object` | Pointer to chunk object structure

### RETURN

  None

### DESCRIPTION

  Performs drawing by coordinate transformation of chunk object (hierarchical model data) with the current matrix. The drawing method can be specified with `njControl3D()` function.

### 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_SPEC_DIR );
      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 );
       njCnkDrawObject( Object );
       xx += 257;
       yy += 179;
       zz += 193;
       njWaitVSync();
      }

### NOTE

  For the chunk format, the image angle and aspect ratio must be set before the light. `njCnkSetAmbient()` is used for setting the ambient light. `njSetConstantAttr()` does not function. This value and the ambient setting on the data side determine the ambient color. Note that the ambient setting will become invalid when converting from the basic model to the chunk model, because the ambient data then become 0.

### REFERENCE

  `njInit3D()
  njControl3D()
  njCnkDrawModel()
  njCnkSetAmbient()
  njSetConstantMaterial()
  `

njCnkDrawObject

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999