Constructs ashaded surface representation of one or more solids described by a set of polygons.
result = POLYSHADE(x, y, z, polygons)
x, y, z
polygons
For example, to render a pyramid consisting of four triangles, polygons will contain 16 elements, made by concatenating four 4-element vectors of the form [3, V0, V1, V2]. V0, V1, and V2 are the indices of the vertices describing each triangle.
Mesh
Normal
Poly_Shades
Shades
T3d
XSize
YSize
CAUTION: If you are using a PostScript or other high resolution graphics device, you should explicitly specify the XSize and YSize parameters. Making the output image of full device size (the default) will result in an insufficient memory error.
POLYSHADE constructs the shaded surface using the scan line algorithm. The shading model is a combination of diffuse reflection and depth cueing. Polygons are shaded in one of two ways:
TIP: Use the SET_SHADING procedure to control the direction of the light source and other shading parameters.
vol = FLTARR(20, 20, 20)
FOR x = 0, 19 DO FOR y = 0, 19 $ DO FOR z = 0, 19 DO $ vol(x, y, z) = SQRT((x-10)^2 + (y-10)^2 + $ (z-10)^2) + 1.5 * COS(z)
Create the volume dataset.
SHADE_VOLUME, vol, 7, v, p
Find the vertices and polygon at a contour level of 7.
SURFACE, FLTARR(2, 2), /Nodata, /Save, $
XRange = [0, 20], YRange = [0, 20], $
ZRange = [0, 20], XStyle = 4, YStyle = 4, $
ZStyle = 4
Set up an appropriate 3D transformation.
image = POLYSHADE(v, p, /T3d)
Render the image. Note that the
T3d
keyword has been set so that
; the 3D transformation established by SCALE3 is used.
TV, image
Display the image.
Figure 2-89 Isosurface at level 7 of volume dataset from example.
Figure 2-90 Isosurface at level 7 of volume dataset from example.
For additional information on defining a coordinate system, see Chapter 5, Displaying 3D Data, in the PV-WAVE User's Guide.