Ninja Library - Drawing Function

njDrawPolygon

Draws a polygon without texture

FORMAT

void njDrawPolygon( *polygon, count, trans )
NJS_POLYGON_VTX *polygon
Int count
Int trans

PARAMETER

 *polygon  Pointer to NJS_POLYGON_VTX structure 
 count  Number of apexes 
 trans  Transparent valid (TRUE), invalid (FALSE) 

RETURN

None

DESCRIPTION

Draws the polygon without texture. The apex count is entered in the strip format.

To use transparent colors, set trans to TRUE. When transparency is not used, set trans to FALSE. The relationship with the Z coordinate of other drawing functions is as follows:

Z = 1/(-z)
z: Coordinate in other drawing function (-65536.f < z < 0.f)

Therefore, the valid range for Z is from 1.0f to infinity.


EXAMPLE

The following draws a square.
The vertex order is as follows.

	1  3

	2  4

NJS_POLYGON_VTX poly[4];
poly[0].x = 100.f;
poly[0].y = 100.f;
poly[0].z = 0.5f;
poly[0].col = 0xFFFFFFFF;
poly[1].x = 100.f;
poly[1].y = 300.f;
poly[1].z = 0.5f;
poly[1].col = 0xFFFFFFFF;
poly[2].x = 300.f;
poly[2].y = 100.f;
poly[2].z = 0.5f;
poly[2].col = 0xFFFFFFFF;
poly[3].x = 300.f;
poly[3].y = 300.f;
poly[3].z = 0.5f;
poly[3].col = 0xFFFFFFFF;
njDrawPolygon( poly, 4, FALSE );

REFERENCE

njDrawTexture()

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