DoPolygon(3D)

NAME
DoPolygon - Create a polygon primitive object

SYNOPSIS
C:
DtObject DoPolygon(colormodel, vertextype, contourcount,
	contours, vertices, shape)
DtColorModel colormodel;
DtVertexType vertextype;
DtInt contourcount;
DtInt contours[contourcount];
DtReal vertices[];
DtShapeType shape;

FORTRAN:
INTEGER*4 DOPGN(COLMOD, VTXTYP, CONCNT,
	CONTURS, VTXS, SHAPE)
INTEGER*4 COLMOD
INTEGER*4 VTXTYP
INTEGER*4 CONCNT
INTEGER*4 CONTURS(CONCNT)
REAL*8 VTXS(*)
INTEGER*4 SHAPE

DESCRIPTION
DoPolygon creates a general polygon primitive object. A general polygon consists of a number of contours comprising the outer boundary (or boundaries) plus any interior holes and/or islands. Contours may be self-intersecting and may intersect each other. The polygon is assumed to be planar.

The parameter colormodel specifies the color model used if the vertices contain color information for shading purposes. The parameter vertextype specifies the exact nature of the vertices. for more information, refer to Chapter 6, Dore Vertex Types, in the Dore Reference Manual or to the VertexTypes on-line manual page.) The parameter vertices is a one-dimensional array of vertex data.

The parameter contourcount specifies the number of contours in the polygon. The parameter contours is an array of contourcount integers, each of which specifies the number of vertices in the associated contour. The first contour in the polygon begins with vertex 0 in the vertices array and continues for the length (in vertices) of the contour. The last vertex of a contour is implicitly connected to its first vertex. The next contour in the polygon begins with the next vertex in the vertices array.

The parameter shape hints at the geometry of the polygon. This argument has meaning only for polygons that consist of a single contour, i.e., whose contourcount is 1. For these polygons, correctly specifying the shape of the contour will result in optimal polygon decomposition when necessary. Incorrectly specifying the shape may result in an incorrect or aborted decomposition. The possible values for shape are:

DcConvex <DCCNVX>
    Path is wholly convex.

DcConcave <DCCNCV>
    Path may be concave but not self-intersecting.

DcComplex <DCCPLX>
    Path may be self-intersecting.

The geometric normal to the polygon is calculated using the right-hand rule (the fingers of the right hand point in the order of vertices and the thumb points in the direction of the normal). This normal is sometimes used by Dore for backface culling and facet shading.

ERRORS
DoPolygon must be called with a valid specification for shape.

[WARNING - invalid parameter]

DoPolygon must be called with at least one contour of three vertices.

[WARNING - insufficient information]

SEE ALSO
DoPolygonMesh(3D), DoSimplePolygon(3D), DoSimplePolygonMesh(3D), VertexTypes(3D)