Ninja Library - Light Function

njCnkSetSimpleLightIntensity

Sets chunk simple light intensity

FORMAT

void njCnkSetSimpleLightIntensity( diff, ambi )
float diff
float ambi

PARAMETER

 diff  Diffuse intensity 
 ambi  Ambient intensity 

RETURN

None

DESCRIPTION

Sets the light intensity for njCnkSimpleDrawObject (njCnkSimpleDrawModel).

njCnkSetSimpleLightIntensity( 1.0f, 0.0f );

In this case, the spot at the opposite of 90 degrees from the light is fully dark. Therefore, a certain amount of ambient light should always be set.

njCnkSetSimpleLightIntensity( 1.0f, 0.2f );

In this case, the image does get darker than 20%.

njCnkSetSimpleLightIntensity( 0.0f, 1.0f );

With 100% for both items, there is no shadow. When the result of light calculation is 1.0 or higher, the light acquires a specular quality.


EXAMPLE

sbInitSystem( NJD_RESOLUTION_640x240_NTSCNI, NJD_FRAMEBUFFER_MODE_RGB565, 1 );
njInitVertexBuffer( 1000000, 0, 1000, 0, 0 );
njInitMatrix( matrix, 8 , 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 );
njClearMatrix();
njTranslate( NULL, 0.f, 0.f, -10.f );
njRotateXYZ( NULL, rx,ry,rz );
njCnkSimpleDrawObject( object );

REFERENCE

njCnkSimpleDrawModel()
njCnkSimpleDrawObject()
njCnkSetSimpleLight()
njCnkSetSimpleLightColor()

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