##### Ninja Library - Model Function

# njCnkSimpleDrawObject

Draws chunk object

### FORMAT

`

  void njCnkSimpleDrawObject( object )
  NJS_CNK_OBJECT *object

`

### PARAMETER

  `*object` | Pointer to chunk model object

### RETURN

  None

### DESCRIPTION

  Performs drawing by coordinate transformation of chunk object (hierarchical model data) with the current matrix. Light setting is performed by dedicated functions.

  njCnkSetSimpleLight()
  njCnkSetSimpleLightIntensity()
  njCnkSetSimpleLightColor()

### 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 );
      njSetView( &view );
      njCnkSetSimpleLight( 0.f, 0.f, 1.0f );
      njCnkSetSimpleLightIntensity( 1.0f, 0.0f );
      njCnkSetSimpleLightColor( 1.0f, 1.0f, 1.0f );
      while(1) {
       njClearMatrix();
       njTranslate( NULL, 0.f, 0.f, -10.f );
       njRotateXYZ( NULL, xx,yy,zz );
       njCnkSimpleDrawObject( 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()` function is used for setting the ambient light. 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. The following chunks formats are not supported.

  | NJD_CS_VN
  | NJD_CS_UVN_VN
  | NJD_CS_UVH_VN
  | NJD_CS_D8
  | NJD_CS_UVN_D8
  | NJD_CS_UVH_D8

### REFERENCE

  `njCnkSetSimpleLight()
  njCnkSetSimpleLightIntensity()
  njCnkSetSimpleLightColor()
  njCnkSimpleDrawModel()
  `

njCnkSimpleDrawObject

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999