POLY_PLOT Procedure
Renders a given list of polygons.
Usage
POLY_PLOT, vertex_list, polygon_list, pg_num, winx, winy, fill_colors, edge_colors, poly_opaque
Input Parameters
vertex_list — A (3, n) array containing the 3D coordinates of each vertex. Must be in device coordinates.
 
note
To obtain device coordinates from data coordinates, use the POLY_NORM, POLY_TRANS, and POLY_DEV functions, in that order.
polygon_list — An array containing the number of sides for each polygon and the subscripts into the vertex_list array.
For more information on the above two parameters, see PV‑WAVE User’s Guide.
pg_num — The total number of polygons to plot.
winx, winy — The x and y dimensions, respectively, of the current plot window in device coordinates.
 
note
The winx and winy parameters are ignored if the Image keyword is present.
fill_colors — The color(s) to fill the polygons with:
*If fill_colors contains fewer than pg_num elements, then all polygons are filled with the color specified by the first element in fill_colors.
*Otherwise, each polygon is filled with the corresponding color found in fill_colors(i).
*To prevent polygon fill, set fill_colors to –1. For example, fill_colors could contain:
*255 — Fill the first polygon with color 255.
*200 — Fill the second polygon with color 200.
*–1 — Don’t fill the third polygon.
*0 — Fill the fourth polygon with color 0.
edge_colors — The color(s) to draw the polygon edges with. edge_colors works in the same manner as fill_colors.
To suppress the plotting of polygon edges, set edge_colors to –1.
 
note
Polygon edges are not plotted if the Image keyword is present.
poly_opaque — The translucency factor to use for plotting each polygon:
*If poly_opaque contains fewer than pg_num elements, then all polygons are plotted with the translucency factor specified by the first element in poly_opaque.
*Otherwise, each polygon is plotted with the corresponding translucency factor found in poly_opaque(i).
*To prevent translucency, set poly_opaque to –1.
A translucency factor of 0 is completely clear. The higher the translucency factor, the more opaque the polygon is. If the maximum value found in Image is 255 and if the maximum color value found in fill_colors is also 255, then a translucency factor of 255 is completely opaque.
 
note
The Image keyword must be used for poly_opaque to take effect.
Keywords
Image — On input, a 2D array containing the image on which to plot the polygons:
*If Image is not present, then the polygons are plotted immediately as generated in the current graphics window.
*If Image is present, then no polygon edges are plotted and the winx and winy parameters are ignored.
On output, Image contains the original image with the polygons plotted on it. This image may then be displayed using TV or other similar routines.
ZClip — If this keyword is present and nonzero, then polygons that do not have at least one vertex in front of the view point are not plotted.
Discussion
POLY_PLOT renders a list of polygons. It is slower than the alternative procedure POLYSHADE, but it is more flexible:
*POLY_PLOT can draw the edges of the polygons, unlike POLYSHADE.
*POLY_PLOT does not fail if one or more polygons have a vertex outside the current plot window, unlike POLYSHADE.
POLY_PLOT uses a simple back-to-front sorting method to determine the polygon plotting order. It does not render polygons with light source shading, but it can plot opaque and translucent polygons. You can also specify the fill color and edge color for each polygon.
Example
See the "Example" section in the description of the POLY_DEV function.
For other examples, see the sphere_demo2, sphere_demo3, and vol_demo4 demonstration programs in:
(UNIX) <wavedir>/demo/arl
(WIN) <wavedir>\demo\arl
Where <wavedir> is the main PV-WAVE directory.
See Also