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

isurfaceexamp.gif

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.

  1. Make sure you are viewing the IDL Visualize Perspective. (Click the Visualize button (viz_button.gif) in the upper right of the Workbench.)
  2. Restore the marbells.dat SAVE file:
  3. 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.

  4. From the Variables View, drag the ELEV variable to the Surface icon in the Tool Palette.

Displaying Surfaces using ISURFACE

You can create the visualization shown in the previous section using the ISURFACE command from the IDL command line:

  1. Restore the marbells.dat SAVE file, as described above.
  2. Load the surface data into the iSurface tool and display it:
  3. ISURFACE, elev

Displaying Shaded Surfaces

In the following example, we will add an external light source to a surface in the iSurface tool.

  1. If you have not already done so, restore the marbells.dat SAVE file.
  2. RESTORE, FILEPATH('marbells.dat',$
        SUBDIRECTORY=['examples', 'data'])

  3. Load the surface data into the iSurface tool and display it.
    contour_8.gif
  4. ISURFACE, elev

  5. Add a light source to the image by selecting Insert → Light.
  6. Select the light bulb icon, and move it around the surface to see how the surface shadows change.

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:

  1. If you have not already done so, restore the marbells.dat SAVE file.
  2. RESTORE, FILEPATH('marbells.dat', $
        SUBDIRECTORY=['examples', 'data'])

  3. Load the surface data into the iSurface tool and display it:
  4. ISURFACE, elev

  5. Select the surface in the iSurface window.
  6. Click Rotate rotate.gif 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 free_rotate_cursor.gif. Click and drag to rotate the surface in the desired direction.
      isurface_rotate.gif
    • To rotate the surface along an axis, position the mouse pointer over an axis so that it changes to an axis rotation pointer axis_rotate_cursor.gif. Click and drag to rotate the surface along the axis in the desired direction.

To rotate a surface in 90° increments left or right:

  1. Select the surface in the iSurface window.
  2. Select Operations → Rotate → Rotate Left or Operations → Rotate → Rotate Right.

To rotate a surface an arbitrary number of degrees:

  1. Select the surface in the iSurface window.
  2. Select Operations → Rotate → Rotate by Angle.
  3. In the Rotate Angle dialog, enter the desired number of degrees to rotate the surface and click OK.

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.