Ninja Library - Model Function

njCnkModDrawModel

Draws modifier model

FORMAT

void njCnkModDrawModel( *model )
NJS_CNK_MODEL *model

PARAMETER

 *model  Pointer to chunk model structure 

RETURN

None

DESCRIPTION

Draws modifier volume model. For this function, only the modifier shape is specified. Models where an actual shadow is to be reflected must be set to receive the modifier influence. This can be achieved by making the following setting before normal model drawing.

njControl3D( NJD_CONTROL_3D_SHADOW );
njSetCheapShadowMode( 128 );


EXAMPLE

sbInitSystem( NJD_RESOLUTION_640x240_NTSCNI, NJD_FRAMEBUFFER_MODE_RGB565, 1 );
njInitVertexBuffer( 500000, 0, 10000, 0, 0 );
njInitMatrix( matrix, 128, 0);
njInit3D( vbuf, 4096 );
njControl3D( NJD_CONTROL_3D_SHADOW );
njSetCheapShadowMode( 128 );
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 );
 njCnkModDrawModel( MODIFIER );
 xx += 257;
 yy += 179;
 zz += 193;
 njWaitVSync();
}

NOTE

For the chunk format, the image angle and aspect ratio must be set before the light. The chunk format for the modifier is limited to NJD_CV for apex chunk and NJD_CO_P3 for strip chunk.

REFERENCE

njControl3D()
njSetCheapShadowMode()
njCnkModDrawObject()

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