VRML_POLY Procedure
Constructs a surface or a solid described by a set of polygons.
Usage
Input Parameters
Keywords
Object Properties
TIP: Browser viewing efficiency is enhanced by using the Solid keyword, because the browser knows to look only at the specified inside or outside of the polygon shape instead of both.
Material Properties
The following properties, when set, are applied to the polygons.
AmbientColor
A (3, n) array of RGB color, in the range of 0 and 255. If AmbientColor is an n-element array, then the color is interpreted as grayscale.
DiffuseColor
A (3, n) array of RGB color, in the range of 0 and 255. If DiffuseColor is an n-element array, then the color is interpreted as grayscale.
EmissiveColor
A (3, n) array of RGB color, in the range of 0 and 255. If EmissiveColor is an n-element array, then the color is interpreted as grayscale.
MaterialIndices
An array of indices into the material property arrays in the range of 0 to n - 1, relating each polygon face to one of the set of material properties (AmbientColor, DiffuseColor, EmissiveColor, Shininess, SpecularColor, Transparency). There should be NPOLY elements in this array (one per polygon). (Default: n = NPOLY, where the set of material properties relates one-to-one to its corresponding polygon)
Shininess
An n-element array of shininess, in the range of 0 to 255.
SpecularColor
A (3, n) array of RGB color, in the range of 0 to 255. If SpecularColor is an n-element array, then the color is interpreted as grayscale.
Transparency
An n-element array of transparency, in the range of 0 to 255.
VertexColor
If set, MaterialIndices are per-vertex rather than per-polygon, so that the material properties describe each vertex, rather than describing each polygon.
Discussion
Example
z = HANNING(14,8) * 10.
POLY_SURF, z, vlist, plist
; Build a vertex/polygon set from surface data.
VRML_OPEN, 'vrml_poly.wrl'
; Open a VRML file.
VRML_LIGHT, [7, 4, 20]
VRML_CAMERA, [0, -0, 20], LookAt = [7, 4, 0]
; Set up a light source and an initial viewpoint.
r = BYTSCL(z(*))
g = BYTSCL(DIST(14, 8))
g = g(*)
b = BYTSCL(INDGEN(14, 8))
b = b(*)
; Make up some RGB color values -- one color for each; element of z (thus, one color per polygon).
rgb = TRANSPOSE([[r], [g], [b]])
; Put the colors into a (3, NPOLY) array.
VRML_POLY, vlist, plist, EmissiveColor = rgb
; Write the surface to the VRML file.
VRML_CLOSE
; Close the VRML file.
See Also
MESH, POLY_MERGE, POLY_PLOT, POLY_SURF, POLYSHADE, VRML_LINE, VRML_OPEN, VRML_SURFACE
For a discussion of VRML polygons, see The VRML Sourcebook, by Andrea L. Ames, et al., John Wiley & Sons, Inc., 1996, Chapter 14.


doc@boulder.vni.com
Copyright © 1999, Visual Numerics, Inc. All rights
reserved.