CREATE_VIEW

The CREATE_VIEW procedure sets the various system variables required to define a coordinate system and a 3D view. This procedure builds the system viewing matrix ( !P.T) in such a way that the correct aspect ratio of the data is maintained even if the display window is not square. CREATE_VIEW also sets the "Data" to "Normal" coordinate conversion factors (!X.S, !Y.S, and !Z.S) so that center of the unit cube will be located at the center of the display window.

CREATE_VIEW sets the following IDL system variables:

!P.T, !P.T3D, !P.Position, !P.Clip, !P.Region !X.S, !X.Style, !X.Range, !X.Margin !Y.S, !Y.Style, !Y.Range, !Y.Margin, !Z.S, !Z.Style, !Z.Range, !Z.Margin.

This routine is written in the IDL language. Its source code can be found in the file create_view.pro in the lib subdirectory of the IDL distribution.

Calling Sequence

CREATE_VIEW

Arguments

This procedure has no required arguments.

Keywords

AX

A floating-point value specifying the orientation (X rotation) of the view. The default is 0.0.

AY

A floating-point value specifying the orientation (Y rotation) of the view. The default is 0.0.

AZ

A floating-point value specifying the orientation (Z rotation) of the view. The default is 0.0.

PERSP

A floating-point value specifying the perspective projection distance. A value of 0.0 indicates an isometric projection (NO perspective). The default is 0.0.

RADIANS

Set this keyword if AX, AY, and AZ are specified in radians. The default is degrees.

WINX

A long integer specifying the X size, in pixels, of the window that the view is being set up for. The default is 640.

WINY

A long integer specifying the Y size, in pixels, of the window that the view is being set up for. The default is 512.

XMAX

A scalar specifying the maximum data value on the X axis. The default is 1.0.

XMIN

A scalar specifying the minimum data value on the X axis. The default is 0.0.

YMAX

A scalar specifying the maximum data value on the Y axis. The default is 1.0.

YMIN

A scalar specifying the minimum data value on the Y axis. The default is 0.0.

ZFAC

Set this keyword to a floating-point value to expand or contract the view in the Z dimension. The default is 1.0.

ZMAX

A scalar specifying the maximum data value on the Z axis. The default is 1.0.

ZMIN

A scalar specifying the minimum data value on the Z axis. The default is 0.0.

ZOOM

A floating-point number or 3-element vector specifying the view zoom factor. If zoom is a single value then the view will be zoomed equally in all 3 dimensions. If zoom is a 3-element vector then the view will be scaled zoom[0] in X, zoom[1] in Y, and zoom[2] in Z. The default is 1.0.

Example

Set up a view to display an iso-surface from volumetric data. First, create some data:

vol = FLTARR(40, 50, 30)

vol(3:36, 3:46, 3:26) = RANDOMU(S, 34, 44, 24)

FOR I = 0, 10 DO vol = SMOOTH(vol, 3)

Generate the iso-surface.

SHADE_VOLUME, vol, 0.2, polygon_list, vertex_list, /LOW

Set up the view. Note that the subscripts into the Vol array range from 0 to 39 in X, 0 to 49 in Y, and 0 to 29 in Z. As such, the 3-D coordinates of the iso-surface (vertex_list) may have the same range. Set XMIN, YMIN, and ZMIN to zero (the default), and set XMAX=39, YMAX=49, and ZMAX=29.

WINDOW, XSIZE = 600, YSIZE = 400

CREATE_VIEW, XMAX = 39, YMAX = 49, ZMAX = 29, $

  AX = (-60.0), AZ = (30.0), WINX = 600, WINY = 400, $

  ZOOM = (0.7), PERSP = (1.0)

Display the iso-surface in the specified view.

img = POLYSHADE(polygon_list, vertex_list, /DATA, /T3D)

TVSCL, img

See Also

SCALE3 , T3D