Ninja Library - Model Function

njCnkEasyDrawModel

Draws chunk model

FORMAT

void njCnkEasyDrawModel( *model )
NJS_CNK_MODEL *model

PARAMETER

 *model  Pointer to chunk model structure 

RETURN

None

DESCRIPTION

Draws the chunk model by coordinate transformation with the current matrix. Front/Back evaluation functions are not supported. (Double Side only)

Light setting is performed by dedicated functions.

 njCnkSetEasyLight()  Sets light 
 njCnkSetEasyLightIntensity()  Sets light intensity 
 njCnkSetEasyLightColor()  Sets light color 

The following chunk formats are supported.

 Apex chunk  NJD_CV_SH, NJD_CV_VN_SH, NJD_CV, NJD_CV_D8, NJD_CV_IN, NJD_CV_IN, NJD_CV_VN, NJD_CV_VNX, NJD_CV_VN_D8 
 Strip chunk  NJD_CS, NJD_CS_UVH, NJD_CS_UVN 


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 );
njCnkSetEasyLight( 0.f, 0.f, 1.0f );
njCnkSetEasyLightIntensity( 1.0f, 0.0f );
njCnkSetEasyLightColor( 1.0f, 1.0f, 1.0f );
while(1) {
 njClearMatrix();
 njTranslate( NULL, 0.f, 0.f, -10.f );
 njRotateXYZ( NULL, xx,yy,zz );
 njCnkEasyDrawModel( 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.

REFERENCE

njCnkSetEasyLight()
njCnkSetEasyLightIntensity()
njCnkSetEasyLightColor()
njCnkEasyDrawObject()

njCnkEasyDrawModel
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999