; Load a color table.
TEK_COLOR
data = HANNING(50, 50)
; Create the 3D spatial transformation. By default, the angle of
; rotation is defined as 30 degrees around the x- and y-axes.
SURFR
; Create the contour plot in the 3D space.
CONTOUR, data, Nlevels=20, /Follow, /T3D, Charsize=1.5
; Now try it with different angles of rotation.
SURFR,Ax=45, Az=10
; Create the contour plot in the 3D space.
CONTOUR, data, Nlevels=20, /Follow, /T3D, Charsize=1.5
SURFACE, data, /Save, Color=3
CONTOUR, data, Nlevels=20, /Follow, /T3D, Charsize=1.5
note | For an informative display, the above example could be done using the SHADE_SURF or SURFACE procedures instead of SURFR, as shown below. (SURFR is not needed in this case because these two procedures themselves set up the 3D view area.) |
xmin = 0 & xmax = 1
xmin = xmin - 1.5 & xmax = xmax+1.5
; Set up scaling for the 3D view.
!x.s = [-xmin,1.0] / (xmax - xmin)
!y.s = !x.s
!z.s = !x.s
; Create the array of vertices.
vert = FLTARR(3, 8)
FOR i=1L, 2 DO vert(0, i) = 1
FOR i=5L, 6 DO vert(0, i) = 1
FOR i=2L, 3 DO vert(1, i) = 1
FOR i=6L, 7 DO vert(1, i) = 1
FOR i=4L, 7 DO vert(2, i) = 1
; Create the connectivity array.
poly = FLTARR(30)
poly(0:4) = [4, 0, 3, 2, 1]
poly(5:9) = [4, 1, 2, 6, 5]
poly(10:14) = [4, 5, 6, 7, 4]
poly(15:19) = [4, 4, 7, 3, 0]
poly(20:24) = [4, 3, 7, 6, 2]
poly(25:29) = [4, 0, 1, 5, 4]
SURFR
img = POLYSHADE(vert, poly, /T3D, /Data)
; Display the cube with the default rotations.
TV, img
SURFR, Ax=50, Az=10
img = POLYSHADE(vert, poly, /T3D, /Data)
; Display the cube rotated 50 degrees around the x-axis and 10
; degrees around the z-axis.
TV, img
note | This example can be done more simply with the CENTER_VIEW procedure, which is available in the Advanced Rendering Library. This library is located: <wavedir>/demo/arl <wavedir>:[DEMO.ARL] <wavedir>\demo\arl Where <wavedir> is the main PV-WAVE directory. For more information, view the .pro file for this procedure. |