Unidraw
viewer.
The main goal has been the creation of a 3D display of terrain with reasonable interactive rendering performance. We have concentrated on providing a vehicle view of the terrain, i.e., a view from a specific 2D position at just above the elevation at that position. This requires the capability to obtain the elevation value at any point within the 2D extent of the elevation model, which will also be useful for displaying features from a 2D vector map database within the 3D display, for example, to display roads on the 3D surface.
The Dem and VtkUnidraw libraries currently provides the following steps for terrain visualization:
The Elevation
class is an abstract base class that defines
a common structure for elevation models. Derived classes like
UsgsDem
know how to read the specific file formats for
particular elevation databases. The usgsdemdump is an example
of this capability: it reads a USGS 1 degree DEM file and prints it out in
text form.
The density of 100-meter and 30-meter elevation datasets is so high that
some form of data reduction must be done in order to obtain good display
performance on today's computers. We have experimented with a
technique called decimation (see chapter 9 in the vtk
book.) Decimation is an algorithm to reduce the number of triangles
in a triangle mesh, preserving the original topology and forming a
good approximation to the original geometry. The advantage of decimation,
as compared to subsampling techniques, is that the mesh is adaptively
modified to retain more detail in areas of high curvature.
We have built
the following pipeline into the usgsdem2vtk program:
vtkStructuredGrid
dataset for each tile
of elevation data. This starts us out with a data structure into
which we insert UTM-projected x,y,z points.vtkStructuredGridGeometryFilter
object. The
output consists of quadrilaterals outlining each group of adjacent
four points.vtkTriangleFilter
object.vtkDecimate
filter. There are various parameters to control the decimation
process. In practice we have found that the feature angle
parameters provide one way to obtain gradually varying output sizes.vtkPolyWriter
object. The file format is native to
vtk and can be read in by the vtkDataSetReader
object.
The demviewer program provides a 3D perspective view of the elevation
data and allows for probing to obtain the elevation value at any x,y
position within the data's extent. It is structured as an
OverlayUnidraw
derived editor with a viewer
(vtkViewer
) that contains a vtk renderer and
custom command menus, buttons, etc. In addition it receives updates
to the camera position
which has been added as CameraPos
and
CameraPath
tools
to the ivmaps sample programs vpfviewer and
dlgviewer.
demviewer provides the following capabilities:
vtkDataSetReader
object reads in files in vtk format created by usgsdem2vtk.
These are piped into vtkPolyMapper
and
vtkActor
to be added to the vtkRenderer
within a VtkViewer
, in a structure similar to other
Unidraw derived programs. (The loading is done manually by selecting an
input file; eventually it should have a positional index and automatically
load the tile at a given position.)
At this point we can set up rendering
related attributes; we currently just use two colors (land and sea)
but this can be extended to provide better visual cues, perhaps with
more colors, texture mapping or other tricks. Also we set up some
lights in the scene; more experimentation with lights could be done
to try to obtain a better picture.vtkProbeFilter
object which performs interpolation to obtain the result. The camera
is updated via the vtkCamera
member functions.Possible future improvements for demviewer:
Last modified: Tue Aug 5 15:32:49 PDT 1997