##### Ninja Library - Model Function

# njSetConstantAttr

Sets model attributes

### FORMAT

`

  void njSetConstantAttr( and_attr, or_attr )
  Uint32 and_attr
  Uint32 or_attr

`

### PARAMETER

  `and_attr` | AND attribute pattern
  `or_attr` | OR attribute pattern

### RETURN

  None

### DESCRIPTION

  Specifies model attribute data.

  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

### EXAMPLE

      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();
      }

### REFERENCE

  `njInit3D()
  njControl3D()
  njDrawModel()
  njDrawObject()
  njCnkDrawModel()
  njCnkDrawObject()
  `

njSetConstantAttr

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999