VRML_SURFACE Procedure
Creates a VRML surface plot based on PV‑WAVE variables.
Usage
VRML_SURFACE, z[, x, y]
Input Parameters
z—A 2D array containing the values that make up the surface. If x and y are supplied, the surface is plotted as a function of the x, y locations. (See the SURFACE and CONTOUR routines for more information.)
x—(optional) A 1D or 2D array specifying the x-coordinates of the data.
y—(optional) A 1D or 2D array specifying the y-coordinates of the data.
Keywords
Light—A 3-element array of [x, y, z] position for a light source, in normal coordinates (0 to 1 is the normalized range).
Title—A string specifying the plot title.
Transform— 4-by-4 matrix containing transformation to apply to object.
XTitle—A scalar string specifying the x-axis title.
YTitle—A scalar string specifying the y-axis title.
ZTitle—A scalar string specifying the z-axis title.
Discussion
The VRML_SURFACE procedure uses PV-WAVE– type variables as input to create a meshed surface in a VRML world.
 
note
The x, y, z data are scaled into a unit cube, so that the axes for the graphic fall within the range of 0 to 1 for all three axes. Use Transform to move the cube around, stretch it, and so on.
Example
; Create 2D arrays of x- and y-coordinates.
x = FINDGEN(21) - 10.0
x = x # REPLICATE(1, 21)
y = TRANSPOSE(x)
; Evaluate a function of x and y for the surface.
z = x * SIN(y) + y * COS(x)
; Open the VRML file.
VRML_OPEN, 'vrml_surf.wrl'
; Set an initial viewpoint.
VRML_CAMERA, [1, -3, 1], LookAt=[.5, .5, .5]
; Write the surface to the VRML file.
VRML_SURFACE, z, x, y, ZTitle = 'f(x, y)', $
   Title = 'f(x, y) = x*sin(y) + y*cos(x)'
; Close the VRML file.
VRML_CLOSE
See Also