How to Create VRML files with IDL
 
To create a VRML file, you must use IDL object graphics instead of IDL direct graphics.  Objects take more explicit commands, but generally a example such as those below can be used as templates to create new programs.  In order to view a VRML file with your browser, you'll need a PlugIn.*

Be aware that objects form a hierarchy.  The following is a list from largest to smallest:

IDLgrWindow or IDLgrVRML
IDLgrView
IDLgrModel
graphics atom, e.g., IDLgrSurface or IDLgrAxis

Example 1:  This is a basic example showing how to create a VRML file of a surface.

Example 2:  This is a slightly more complex example where a file is read and a multicolor image from a 2D array is saved to a VRML file.

Example 3:  A surface is plotted from the same data as Example 2.  Axes are placed on the sides of the surface.  The surface is colored to reflect the z values.
Example 3A:  As a slight variant to Example 3; the first data array, dat0, is used to create the surface.  The second data array, dat1, is used to position the color that is used on the surface.
Example 3B:  This is another variation of the main example.  Features in this code include: (1) Changing the font and font size on the axis values, (2) adding a title to the axes, (3) using a custom made function for drafting gridelines to enclose the surface plot, (4) moving the z axis to the rear of the plot (away from the origin) and (5) using a different color table.

Example 4:  Again, the same data is used from examples 2 and 3.  This time, a 2D colored image is overlain by a wire-mesh surface, which in turn is overlain by contours.
 

*Helpful hint:  If you use libcosmoplayer.so as your PlugIn, use the right mouse button to pull up a menu. Then choose "viewer" and change to "examiner."  It seems to have an easier interface (trackball and zoom dial).  You may also need to turn the "headlight" on in the pop-up menu.