CS 418: Laboratory 8
Modeling and Scientific Visualization
Introduction.
Scientific visualization is a term which refers to the process of converting
data into pictures. This lab will demonstrate several of the techniques
of visualization. The techniques will be used to view a simulated landscape,
complete with rivers and clouds. The examples shown below are the result
of calculating:
- A height field, z=f(x,y), and displaying it as landscape.
The blue is a flat polygon simulating a water surface.

- A density field d=f(x,y,z) and displaying it as a cloud, either by
volume rendering or by isosurface extraction followed by polygon rendering.
- A set of rivers determined by plotting streamlines of the gradient of
the height field. The gradient vectorfield and the streamlines are shown also.
The vectorfield can be considered an "plan view" of the landscape slopes.
The third image shows a landscape with about 100 stream start locations.


Procedure:
You will need to download the programs
The Landscape program caluclates a 2D field of altitudes to make a landscape.
The cloud program calculates a 3D scalar field of densities to use as a cloud.
These two fields are manipulated (e.g. to derive the slope of the
surface), then visualized. New modules which are used include the:
- Isosurface module which fits polygons to points of equal
field strength in a 3D field.
- AutoGlyph module which constructs an arrow at every point in
a vector field
- Streamline module which follows a vector field in its direction of flow.
- Refine module which interpolates points into a field.
- Map module which allows the data in one field to be interpolated onto
the positions of another field.
- FFT module which converts a spatial representation to a frequency
representation.
You may want to look at the DX example programs
for further examples that
use these modules. Look in
the default directory shown when you launch DX
and open a program. You may also want to look at a
visualization tutorial
which describes the visualization uses of DX.
Assignment:
Run the programs a few times to see what they do. Try out various options
on the control panels. Refer also to a visualization tutorial
example.
Modify the program to add the following features:
-
Add the cloud program to the landscape program so that you can
have a cloud in the scene. Several interactors will need to be added to
support the cloud. The interactors in the cloud program should be added,
as well as a switch to turn off the cloud, a cloud position and cloud
scale controls (vector interactors).
-
Modify the height calculation so that the mountains follow a powerlaw
of the fractally determined heights. That is,
hmod = mag*(hfractal) n
This will make the landscape "flatter" near zero elevation to simulate
erosion. Make sure that you can handle any positive power n (e.g. n=2 or
n=2.5). The "mag" parameter should be an interactor to set the vertical
scale of the mountains.
- Modify the surface color so that it is selectable to be:
- Green near ocean level and white
at mountain peaks with pale yellow in between.
- Colored on a rainbow scale according to slope
(magnitude of the gradient) so that red is maximum
slope and blue is zero slope.

- Modify the program to grow "trees" on the surface. The trees should
start out small and become larger. There should be
some random component to the rates for each location, but overall
they should grow slower at high altitudes and not at all under water.
The Glyph
module will produce arrows when given a vector field.
If the "type" input of the Glyph module is given a geometry (say
a cone) it will place it at every point on the surface. If you
use a parametric surface as an input be sure to run it through
a Refine module with the "level" input set to "triangles".
You can use an Include module to limit the trees to a band of elevations,
as shown below.
You will probably want to use a Reduce module to lower the density
of trees on the surface.
Some results from 1996 .
You will need to demo all of the assigned functions in one modified net
with the appropriate interactors to control the functions you have added.
As usual, the style of the program will be graded, as will its function.
The tree animation may be in a separate program.
The
Lab 8 grading guide
will be filled out by a consultant during section to evaluate your work.
Copyright Statement