and_attr | AND attribute pattern |
or_attr | OR attribute pattern |
Use AND pattern or OR pattern with original attribute specified.
Basic model effective when NJD_CONTROL_3D_CONSTANT_ATTR is specified for njControl3D() function.
CHUNK model effective when NJD_CONTROL_3D_CNK_CONSTANT_ATTR is specified for njControl3D() function.
Types of Attribute Flags
Basic Models
NJD_FLAG_IGNORE_LIGHT | Does not calculate light sources |
NJD_FLAG_IGNORE_SPECULAR | Ignores specular |
NJD_FLAG_USE_FLAT | Sets flat shading |
NJD_FLAG_DOUBLE_SIDE | Sets double-sided polygons |
NJD_FLAG_USE_ENV | Enables environment mapping |
NJD_FLAG_USE_TEXTURE | Enables texture mapping |
NJD_FLAG_USE_ALPHA | Enables translucent polygons |
NJD_FLAG_FLIP_U | Flips textures in the U direction |
NJD_FLAG_FLIP_V | Flips textures in the V direction |
NJD_FLAG_CLAMP_U | Clamps textures in the U direction |
NJD_FLAG_CLAMP_V | Clamps textures in the V direction |
NJD_FLAG_USE_ANISOTROPIC | Uses anisotropic filtering for textures |
Chunk models
NJD_FST_IL | Does not calculate light sources |
NJD_FST_IS | Ignores specular |
NJD_FST_IA | Ignores ambient |
NJD_FST_FL | Sets flat shading |
NJD_FST_DB | Sets double-sided polygons |
NJD_FST_ENV | Enables environment mapping |
NJD_FST_UA | Enables translucent polygons |
The following displays textured polygon as monotone and flat. 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 ); njCreateLight( &light, NJD_DIR_LIGHT ); njSetView( &view ); njControl3D( NJD_CONTROL_3D_NO_CLIP_CHECK | NJD_CONTROL_3D_DISP_AXIS ); njSetConstantAttr( ~NJD_FLAG_USE_TEXTURE, NJD_FLAG_USE_FLAT ); while(1) { njClearMatrix(); njTranslate( NULL, 0.f, 0.f, -10.f ); njRotateXYZ( NULL, xx,yy,zz ); njDrawModel( model ); xx += 257; yy += 179; zz += 193; njWaitVSync(); }