Displaying Surfaces
You can easily create surface visualizations using the Tool Palette in the IDL Visualize perspective or from the command line with the ISURFACE command. Either way, the visualization displays in the IDL iSurface tool, which allows you to visualize, modify, and manipulate surfaces in an interactive environment.
Displaying Surfaces using the Tool Palette
In this example, we use the RESTORE procedure, which loads IDL variables and routines into memory that were previously saved to a file by the SAVE procedure.
- Make sure you are viewing the IDL Visualize Perspective. (Click the Visualize button (
) in the upper right of the Workbench.) - Restore the
marbells.datSAVE file: - From the Variables View, drag the
ELEVvariable to the Surface icon in the Tool Palette.
RESTORE, FILEPATH('marbells.dat', $
SUBDIRECTORY=['examples', 'data'])
By restoring marbells.dat, the array variable ELEV is loaded into memory, and displays in the Variables view in the Workbench.
Displaying Surfaces using ISURFACE
You can create the visualization shown in the previous section using the ISURFACE command from the IDL command line:
Displaying Shaded Surfaces
In the following example, we will add an external light source to a surface in the iSurface tool.
- If you have not already done so, restore the
marbells.datSAVE file. - Load the surface data into the iSurface tool and display it.

- Add a light source to the image by selecting Insert → Light.
- Select the light bulb icon, and move it around the surface to see how the surface shadows change.
RESTORE, FILEPATH('marbells.dat',$
SUBDIRECTORY=['examples', 'data'])
Modifying Surfaces
The iSurface tool allows you to manipulate and modify displayed surfaces. For example, rotation tools are provided to make it easier to see all aspects of a 3-D surface.
To rotate a surface freely or along an axis:
- If you have not already done so, restore the
marbells.datSAVE file. - Load the surface data into the iSurface tool and display it:
- Select the surface in the iSurface window.
- Click Rotate
on the window toolbar. The rotation sphere is displayed around the surface. - To rotate the surface freely, position the mouse pointer over the surface so that it changes to a free rotation pointer
. Click and drag to rotate the surface in the desired direction.

- To rotate the surface along an axis, position the mouse pointer over an axis so that it changes to an axis rotation pointer
. Click and drag to rotate the surface along the axis in the desired direction.
RESTORE, FILEPATH('marbells.dat', $
SUBDIRECTORY=['examples', 'data'])
To rotate a surface in 90° increments left or right:
To rotate a surface an arbitrary number of degrees:
Alternately, you can rotate the surface programmatically, using the IROTATE procedure:
ISURFACE, elev
IROTATE, 'surface', 10, /XAXIS
IROTATE, 'surface', 10, /YAXIS
There are many other ways to modify a surface in the iSurface tool, including manipulating surface color, texture mapping, and surface annotation. For more information on working with the iSurface tool, see Working with Surfaces.
