PV-WAVE Foundation > User Guide > Rendering Techniques > Demonstration Programs
Demonstration Programs
Use the following sources for advanced rendering demonstration programs:
*Run the demonstration programs and look at the code in:
(UNIX) <wavedir>/demo/arl
(WIN) <wavedir>\demo\arl
Where <wavedir> is the main PV‑WAVE directory.
*Run the PV‑WAVE Demonstration Gallery and look at Gallery code examples.
Demonstration Programs in the Examples Directory
Before running these programs on a UNIX system, be sure to read the ARL section of the PV‑WAVE Tips and Technical Notes for important information.
To run Advanced Rendering Library demonstration programs:
*Change to the examples directory and start PV‑WAVE.
*At the WAVE> prompt, enter the name of the program you want to run. For example:
WAVE> vol_demo1
*If you want to run another program, start a new session (exit and re-enter PV‑WAVE) before typing in another program name. Exiting insures that all variables are cleared, and that none of the data or displays from the previous programs interfere with the new demonstration program.
Ray Tracing Demonstration (Render Directory)
For a quick demonstration of ray tracing applications, look at the demonstration programs in one of the following directories:
(UNIX) <wavedir>/demo/render
(WIN) <wavedir>\demo\render
Where <wavedir> is the main PV-WAVE directory.
Then, enter the following commands:
; Quadric animation—Shows earth revolving for several 
; revolutions. 
WAVE> show_anim
; Polygonal mesh with many polygons (iso-surfaces)
WAVE> show_iso_head
; Slicing a volume.
WAVE> show_slic_head
; Rendering an iso-surface with voxel values.
WAVE> show_flat_head
; Diffuse and partially transparent iso-surfaces. 
WAVE> show_tran_head
 
; Rendering iso-surfaces with transformation matrices.
; Renders two volumes in the same scene.
WAVE> show_core_head
The above routines display the resulting rendered images that have already been created with gen_* routines and then stored in files. To get a feel for how long it actually takes to create these rendered images on your workstation, enter the following commands.
; Quadric animation.
WAVE> gen_amin
; Polygonal mesh with many polygons.
WAVE> gen_iso_head
; Slicing a volume.
WAVE> gen_slic_head
; Rendering an iso-surface with voxel values.
WAVE> gen_flat_head
; Diffuse and partially transparent iso-surfaces.
WAVE> gen_tran_head
; Rendering iso-surfaces with transformation matrices. 
; Renders two volumes in the same scene.
WAVE> gen_core_head
SLICE_VOL Function and VIEWER Procedure Demonstrations
These two routines can be used to manipulate and view portions of volumes.
The SLICE_VOL function returns a two-dimensional array containing a slice from a 3D volumetric array. You can demonstrate the SLICE_VOL function using the Medical Imaging and CFD/Aerospace buttons of the PV‑WAVE Demonstration Gallery.
The VIEWER procedure lets you interactively define a 3D view, a slicing plane, and multiple cut-away volumes. You can demonstrate the VIEWER procedure using the 4-D Data, Medical Imaging, Oil/Gas Exploration, and CFD/Aerospace buttons of the PV‑WAVE Demonstration Gallery.
Tables of Demonstration Programs
Table 7-1: Polygon Rendering, Table 7-2: Volume Rendering, Table 7-3: Polygon and Volume Rendering, and Table 7-4: Gridding summarize the demonstration programs and list the rendering routines that are used in these programs.
The demonstration programs listed in the tables are located in the render and arl directories in:
(UNIX) <wavedir>/demo
(WIN) <wavedir>\demo
Where <wavedir> is the main PV-WAVE directory.
 
Polygon Rendering  
Demonstration Programs
Routines Used
poly_demo1
 
Displays a perspective view of a surface from a viewpoint within the data.
SET_VIEW3D
POLY_SURF
POLY_NORM
POLY_TRANS
POLY_DEV
POLY_C_CONV
POLY_PLOT
grid_demo4
 
Shows 4D gridding and a cut-away view of a block of volume data.
GRID_4D
VOL_PAD
CENTER_VIEW
SHADE_VOLUME
POLYSHADE
f_gridemo4
 
Shows 4D gridding and a cut-away view of a block of volume data.
FAST_GRID4
VOL_PAD
CENTER_VIEW
SHADE_VOLUME
POLYSHADE
cube1
 
Constructs a polygonal mesh of diffusely shaded polygons. This program is not on the tape.
MESH, RENDER
cube2
 
Constructs a polygonal mesh of flat-shaded polygons.This program is not on the tape.
MESH, RENDER
gen_iso_head
 
show_iso_head
 
Creates a human head using a polygonal mesh with 52,500 polygons.
SHADE_VOLUME
MESH, RENDER
 
sphere_demo1
 
Displays an image warped onto a sphere.
POLY_SPHERE
CENTER_VIEW
POLYSHADE
sphere_demo2
 
Displays data warped onto an irregular sphere.
POLY_SPHERE
CENTER_VIEW
POLYSHADE
POLY_COUNT
POLY_NORM
POLY_TRANS
POLY_DEV
POLY_C_CONV
POLY_PLOT
sphere_demo3
 
Displays multiple spheres merged together.
GRID_SPHERE
POLY_SPHERE
POLY_COUNT
POLY_TRANS
POLY_MERGE
CENTER_VIEW
POLYSHADE
POLY_NORM
POLY_DEV
POLY_PLOT
grid_demo5
 
Shows spherical gridding.
GRID_SPHERE
POLY_SPHERE
CENTER_VIEW
POLYSHADE
gen_anim
show_anim
 
Constructs a “movie” of an orbit around a sphere. This program takes several minutes to run.
SPHERE
RENDER
 
Volume Rendering  
Demonstration Programs
Routines Used
vec_demo1
 
Displays a 3D vector field from X-Y-Z data.
VECTOR_FIELD3
vec_demo2
 
Displays a 3D vector field from the volumetric data with specified starting points for the vectors.
CONV_TO_RECT
VECTOR_FIELD3
vol_demo1
 
Displays a 3D fluid flow vector field with random starting points for the vectors.
CONV_TO_RECT
VECTOR_FIELD3
gen_slic_head
 
show_slic_head
 
Demonstrates the rendering of selected slices through some volume data.
VOLUME
RENDER
gen_flat_head
 
show_flat_head
 
Renders a diffuse iso-surface with voxel values.
VOLUME
RENDER
gen_tran_head
 
show_tran_head
 
Renders both a diffuse iso-surface together with a partially transparent iso-surface.
VOLUME
RENDER
gen_core_head
 
show_core_head
 
Renders a diffuse iso-surface using actual voxel values Demonstrates the rendering of two volumes into a single image.
VOLUME
RENDER
 
Polygon and Volume Rendering  
Demonstration Programs
Routines Used
vol_demo2
 
Displays an MRI scan of a human head using three different display techniques. This demonstration takes a while to run.
VOL_PAD
CENTER_VIEW
VOL_MARKER
SHADE_VOLUME
POLYSHADE
VOL_TRANS
VOL_REND
vol_demo3
 
Displays 3D fluid data using two display techniques.
CENTER_VIEW
SHADE_VOLUME
POLYSHADE
VOL_PAD
VOL_TRANS
VOL_REND
vol_demo4
 
Similar to grid_demo3, but also renders the data using POLY_PLOT and VOL_REND.
GRID_4D
VOL_PAD
CENTER_VIEW
SHADE_VOLUME
POLYSHADE
POLY_NORM
POLY_TRANS
POLY_DEV
POLY_COUNT
POLY_PLOT
VOL_TRANS
VOL_REND
 
Gridding  
Demonstration Program
Routines Used
f_gridemo2
 
Shows 2D gridding with dense data input.
FAST_GRID2
f_gridemo3
 
Shows 3D gridding with dense data input.
FAST_GRID3
f_gridemo4
 
Shows 4D gridding with dense data input.
FAST_GRID4
grid_demo2
 
Shows 2D gridding with sparse data input.
GRID_2D
grid_demo3
 
Shows 3D gridding with sparse data input.
GRID_3D
grid_demo4
 
Shows 4D gridding with sparse data input.
GRID_4D
grid_demo5
 
Shows spherical gridding.
GRID_SPHERE
 
note
The Advanced Rendering Library also contains the demonstration program, img_demo1. This program displays a pseudo true-color Landsat image on an 8-bit color system. On some systems, you may need to click in the Wave 0 window to see the proper colors.