[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

polygonlist or polylinelist Subroutine

Purpose

Draws multiple, disjointed polygons or polylines.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void polygonlist(Int32 num_polygons, Int32 type, void *se)
void polylinelist(Int32 num_polylines, Int32 type, void *se)

FORTRAN Syntax

SUBROUTINE POLYLI(num_polygons, type, se)
INTEGER*4 num_polygons, type, se(1)
SUBROUTINE  LINELI(num_polylines, type, se)
INTEGER*4 num_polylines, type, se(1)

Description

The polygonlist subroutine draws multiple, disjoint polygons.

The polylinelist subroutine draws multiple, disjoint polylines. Polylines can be lit and/or shaded; therefore, polylines may be specified with color and/or normal data.

If lighting is not enabled, all normal data is ignored. If no color data is supplied, the polygons or polylines are rendered with the current color. If lighting is enabled, color data is interpreted according to the current setting of the lmcolor attribute.

  1. The Supergraphics Processor Subsystem does not support lit and/or smooth-shaded polylines. It does support flat-shaded polylines.
  2. The Supergraphics Processor Subsystem does not support 4-dimensional data. It does support 2- and 3-dimensional data.
  3. These subroutines may not buy a performance improvement over begin-end style rendering on the POWERgraphics GXT1000. Begin-end style rendering has been highly optimized on the GXT1000.

Parameters

num_polygons Specifies the number of polygons to be defined in the array pointed to by the se parameter in the polygonlist subroutine.
num_polylines Specifies the number of polylines to be defined in the array pointed to by the se parameter in the polylinelist subroutine.
type Specifies a bitflag indicating whether normals and/or colors are present in the data and whether the vertex data is 2-, 3-, or 4-dimensional. This bitflag is formed by using the bitwise OR operator to combine the following tokens:
SE_2D Indicates that the vertex coordinates are 2-dimensional.
SE_3D Indicates that the vertex coordinates are 3-dimensional.
SE_4D Indicates that the vertex coordinates are 4-dimensional.
SE_NORM Indicates that normal data is present.
SE_COLOR Indicates that color index data is present.
SE_RGB Indicates that RGB data is present.
se Points to an array of mixed integer, binary, and floating point data. The array is a concatenation of a number of separate, disjoint polygons (polylines) as follows:
Polygons Data Structure
Word Parameter Type
0 polygon (1) polygon format
. polygon (2) polygon format

...
. polygon (n) polygon format

Each polygon consists of an integer indicating the number of vertices in that polygon, followed by vertex, normal, and color information. If the array is considered as a linear array of 32-bit words, the structure of the polygon data must be as follows:

Individual Polygon Data Structure
Word Parameter Type
+0 num verts signed 32-bit integer
+1 vertex (1) vertex data
. vertex (2) vertex data

...
. vertex (n) vertex data

Each vertex has one of a number of formats, depending on the setting of the flag word. The flag bits indicate whether a normal vector is or is not present, whether a color is or is not present, and whether the point data is 2-, 3-, or 4-dimensional. Therefore, the potential data for a vertex data structure is as follows:

Potential Vertex Data Structure
Word Parameter Type
+ 0 x IEEE short Floating Point
+1 y IEEE short Floating Point
+2 if 3D z IEEE short Floating Point
+3 if 4D w IEEE short Floating Point
2/3/4+0 if NORM nx IEEE short Floating Point
2/3/4+1 if NORM ny IEEE short Floating Point
2/3/4+2 if NORM nz IEEE short Floating Point
2...7+0 if CI color index IEEE integer
2...7+0 if RGB color r IEEE short Floating Point
2...7+1 if RGB color g IEEE short Floating Point
2...7+2 if RGB color b IEEE short Floating Point

More specifically, if there is no normal or color data, and the point contains only 2-dimensional data, a vertex data structure is no more than a pair of floating point numbers as follows:

type = SE_2D

Word Parameter Type
0 x IEEE short Floating Point
1 y IEEE short Floating Point

If a normal vector is to be specified with 3-dimensional data, the vertex data structure would be as follows:

type = SE_3D | SE_NORM
Word Parameter Type
0 x IEEE short Floating Point
1 y IEEE short Floating Point
2 z IEEE short Floating Point
3 nx IEEE short Floating Point
4 ny IEEE short Floating Point
5 nz IEEE short Floating Point

A 4-dimensional vertex with color index data would have the following data structure:

type = SE_4D | SE_COLOR
Word Parameter Type
0 x IEEE short Floating Point
1 y IEEE short Floating Point
2 z IEEE short Floating Point
3 w IEEE short Floating Point
4 color index 32-bit integer

A 3-dimensional vertex with both normal and color data would have the following data structure:

type = SE_3D | SE_NORM | SE_RGB
Word Parameter Type
0 x IEEE short Floating Point
1 y IEEE short Floating Point
2 z IEEE short Floating Point
3 nx IEEE short Floating Point
4 ny IEEE short Floating Point
5 nz IEEE short Floating Point
6 R IEEE short Floating Point
7 G IEEE short Floating Point
8 B IEEE short Floating Point

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

Allowing the system to draw concave polygons with the concave subroutine.

Specifying the next point in a polygon with the pdr subroutine.

Specifying the starting point for a polygon with the pmv subroutine.

Drawing a relative polygon with the rpdr subroutine.

Moving the current graphics position to a starting point for a filled polygon relative to the current point with the rpmv subroutine.

AIX Graphics Library Overview, Setting Drawing Attributes, Creating Lighting Effects.

Drawing Rectangles, Circles, Arcs, and Polygons.


[ Previous | Next | Contents | Glossary | Home | Search ]