Ninja Library - Model Function

njCnkSimpleDrawModel

Draws chunk model

FORMAT

void njCnkSimpleDrawModel( *model )
NJS_CNK_MODEL *model

PARAMETER

 *model  Pointer to chunk model structure 

RETURN

None

DESCRIPTION

Performs drawing by coordinate transformation of chunk 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 );
 njCnkSimpleDrawModel( model );
 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.

REFERENCE

njCnkSetSimpleLight()
njCnkSetSimpleLightIntensity()
njCnkSetSimpleLightColor()
njCnkSimpleDrawObject()

njCnkSimpleDrawModel
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999
   NJD_CS_VN 
   NJD_CS_UVN_VN 
   NJD_CS_UVH_VN 
   NJD_CS_D8 
   NJD_CS_UVN_D8 
   NJD_CS_UVH_D8