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

## polf Subroutine

### Purpose

Draws a filled polygon.

### Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

### C Syntax

`void polf(Int32 n, Coord parray[ ])`
`void polfi(Int32 n, Icoord parray[ ])`
`void polfs(Int32 n, Scoord parray[ ])`
`void polf2(Int32 n, Coord parray[ ])`
`void polf2i(Int32 n, Icoord parray[ ])`
`void polf2s(Int32 n, Scoord parray[ ])`

### FORTRAN Syntax

```SUBROUTINE POLF(n, parray)
INTEGER*4 n
REAL parray(3,n)```
```SUBROUTINE POLFI(n, parray)
INTEGER*4 n
INTEGER*4 parray(3,n)```
```SUBROUTINE POLFS(n, parray)
INTEGER*4 n
INTEGER*2 parray(3,n)```
```SUBROUTINE POLF2(n, parray)
INTEGER*4 n
REAL parray(2,n)```
```SUBROUTINE POLF2I(n, parray)
INTEGER*4 n
INTEGER*4 parray(2,n)```
```SUBROUTINE POLF2S(n, parray)
INTEGER*4 n
INTEGER*2 parray(2,n)```

### Description

The polf subroutine draws filled polygons using the current area attributes: pattern, color, and writemask. Polygons are represented as arrays of points. The first and last points automatically connect to close a polygon. After the polygon is filled, the current graphics position is set to the first point in the array.

Polygons in 2-D are drawn with z = 0.

The six different forms for the polf subroutine are as follows:

 2-D 3-D Int16 polf2s polfs Int32 polf2i polfi float polf2 polf

The syntax for each of the subroutine forms is the same except for the first argument. They differ only in that polf expects real coordinates, polfi expects integer coordinates, and polfs expects short integer coordinates. In addition, the polf2 routines assume a 2-D point instead of a 3-D point.

There can be no more than 256 vertices in a polygon. In addition, the polf subroutine cannot correctly draw polygons that intersect themselves.

### Parameters

 n Specifies the number of points in the polygon. parray Specifies an array containing the vertices of the polygon.

### Example

The example C language program tpbig.c uses the polf2i subroutine to draw an ice cream cone.

### 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 polygon with the poly subroutine.

Drawing a filled rectangle with the rectf subroutine.

Drawing a rectangle with the rect 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, and Drawing Rectangles, Circles, Arcs, and Polygons.

[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]