POLYGON(3G)
NAME
polygon − define polygonal region to be filled and/or edged
SYNOPSIS
C Syntax:
void polygon2d(fildes,clist,numverts,flags);
int fildes,flags,numverts;
float clist[];
void polygon3d(fildes,clist,numverts,flags);
int fildes,flags,numverts;
float clist[];
void dcpolygon(fildes,clist,numverts,flags);
int fildes,flags,numverts;
int clist[];
FORTRAN77 Syntax:
subroutine polygon2d(fildes,clist,numverts,flags)
integer*4 fildes,flags,numverts
real clist(numverts*(2+flags))
subroutine polygon3d(fildes,clist,numverts,flags)
integer*4 fildes,flags,numverts
real clist(numverts*(3+flags))
subroutine dcpolygon(fildes,clist,numverts,flags)
integer*4 fildes,flags,numverts
integer*4 clist(numverts*(2+flags))
Pascal Syntax:
procedure polygon2d(fildes:integer;
var clist:array[lo..hi:integer] of real;
numverts,flags:integer);
procedure polygon3d(fildes:integer;
var clist:array[lo..hi:integer]of real;
numverts,flags:integer);
procedure dcpolygon(fildes:integer;
var clist:array[lo..hi:integer] of integer;
numverts,flags:integer);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
flags If set to FALSE (0), all edges are drawn if interior_style is set to be edged.
If set to TRUE (1), each polygon edge can be either a drawn boundary or a non-drawn boundary, depending on the value of the corresponding move/draw indicator and whether or not interior_style is set to be edged. If the indicator is non-zero (draw) and interior_style is set to edged, the boundary is drawn. Otherwise, it is not drawn. Non-drawn boundaries simply define the edges of the filled area.
clist Array of real endpoint data or device coordinate data with or without move/draw indicators embedded after each endpoint.
numverts Number of polygon vertices in the clist array.
Discussion
A boundary of a polygonal region is defined by connecting each vertex to it successor in the vertex list.
The polygon is filled and/or outlined according to current interior style, fill color and perimeter attributes. As with all output primitives it is affected by the current drawing mode and write enable.
Move/draw indicators occupy the same space as one coordinate (a single 32-bit value), and are interspersed with the coordinate data. For polygon2d, each (x,y) pair of coordinates is followed by a move/draw indicator if flags is TRUE (1 for Pascal). For polygon_3d, each (x,y,z) triplet is followed by a move/draw indicator if flags is TRUE (1 for Pascal).
Each entry in the clist can contain any number of coordinates. The actual number depends on the coord parameter specified in vertex_format. The coord parameter can be used to skip over any extra coordinates following the usual 2, 3, or 4 that can be specified with this procedure. Vertex move/draw flags follow the skipped extra coordinates.
The use parameter specified in vertex_format determines whether any of the extra parameters are used to determine the color of the primitive. The following list shows in what order the data is expected. Any extra coordinates are skipped.
use=0 For 2d,dc: x,y,...,(flag)
For 3d: x,y,z,...,(flag)
use=1 For 2d,dc: x,y,i,...,(flag)
For 3d: x,y,z,i,...,(flag)
use=3 For 2d,dc: x,y,a,b,c,...,(flag)
For 3d: x,y,z,a,b,c,...,(flag)
Upon entry, the polygon vertex list is added to, not cleared, upon entry. The polygon list is then processed by filling all vertices in the list, and cleared upon exit. The flag at the beginning of partial_polygon. is used to create sub-polygons.
The current position is updated to the first vertex in the first partial_polygon/polygon upon completion of the polygon.
If per-polygon normal is set in vertex_format, the first vertex in polygon3d is used as a normal to that polygon, and the number of vertices in the clist should be numverts + 1. The normal must contain the same number of coordinates as every other vertex (extra coordinates are ignored).
SEE ALSO
drawing_mode(3G), fill_color(3G), interior_style(3G), partial_polygon(3G), perimeter_color(3G), perimeter_type(3G), perimeter_repeat_length(3G), write_enable(3G),
vertex_format(3G).
Hewlett-Packard Company — May 11, 2021