njDrawPolygon3D | Japanese
    <-|INDEX|->
Draws a polygon in 3D space.

### FORMAT

      #include <Ninja.h>
      void njDrawPolygon3D(*p, n, attr)
      NJS_POINT3COL *p
      Int n
      Uint32 attr

### PARAMETERS

*p
  list of coordinates of vertices of a polygon to be drawn
n
  number of vertices of a polygon
attr
  attributes (specifies the drawing method)

### RETURN VALUE

  None

### FUNCTION

- Draws a polygon of n sides.
- The following four attributes can be used.

  NJD_DRAW_NORMAL | Normal drawing.
  NJD_FILL | Drawing with interior fill.
  NJD_TRANSPARENT | Transparent drawing.
  NJD_USE_TEXTURE | Drawing with texture.

  These attributes can be used in mutually consistent combinations by using the "|" character as a delimiter.

### EXAMPLE

  The following draws 100 squares at random.

      int i;

      NJS_POINT3COL p;
      NJS_POINT3 point[4];
      NJS_COLOR color[4];

      p->p = point;
      p->col = color;
      p->tex = NULL;
      p.num = 4;

      for(i = 0; i< 100; i++){
          int j;
          p->p[0].x = njRandom()*1000.f-500.f;
          p->p[0].y = njRandom()*1000.f-500.f;
          p->p[0].z = -3000.f+(float)i;
          p->p[1].x = p->p[0].x-polysize;
          p->p[1].y = p->p[0].y;
          p->p[1].z = p->p[0].z;
          p->p[2].x = p->p[0].x-polysize;
          p->p[2].y = p->p[0].y-polysize;
          p->p[2].z = p->p[0].z;
          p->p[3].x = p->p[0].x;
          p->p[3].y = p->p[0].y-polysize;
          p->p[3].z = p->p[0].z;

          for(j = 0; j < 4; j++){
              p->col[j].argb.a = (Uint8)(0x80*njRandom());
              p->col[j].argb.r = (Uint8)(0x80*njRandom());
              p->col[j].argb.g = (Uint8)(0x80*njRandom());
              p->col[j].argb.b = (Uint8)(0x80*njRandom());
          }
          njDrawPolygon3D(&p, 4, NJD_DRAW_NORMAL|NJD_FILL);

Since this function draws in 3D, the view, screen, and matrix stack settings must be made before using it.

### NOTES

- The NJD_DRAW_NORMAL may be omitted when it is used in combination with other attributes.

### RELATED TOPICS

njDrawPolygon3D |
    <-|INDEX|->