    OPERATING INSTRUCTIONS FOR 3-DEM RAYTRACE SOFTWARE (Version 2.1)


1. CONCEPT OF OPERATION

   3-DEM will produce ray traced landscape scenes from USGS Digital
Elevation Model (DEM) files, NASA Mars Digital Topographic Map (DTM) files,
or any topographic data file which is organized by rows and columns of
elevation data.  3-DEM can produce color three dimensional projections, or
red-blue projections which require the use of red-blue 3D glasses for
viewing.  Completed scenes can be saved as Windows bitmaps for transfer to
other applications.


2. EQUIPMENT REQUIRED

   3-DEM is designed to run under Windows 95 with 256 color graphics.  Use
of greater than 8 bit color may produce unpredictable results and is NOT
RECOMMENDED.  A 486 or better microprocessor and math co processor are
recommended.  You won't be happy with the program's speed if you use anything
less than this.  At least 8 MBytes of memory is REQUIRED.  And if you can
afford 16 MBytes, it will significantly improve performance on large DEM
files.


3. SEQUENCE OF OPERATIONS

   To produce a three dimensional scene you must perform four operations in
sequence with the 3-DEM software as follows:

   STEP 1 - Load a new DEM or DTM file and draw an overhead map of scaled
altitude data.  Choose "New DEM" or "New DTM" from the "File" menu and select
the file to be loaded into 3-DEM.  If the file is of the correct type, 3-DEM
will then draw an overhead map of the entire geographical area with color
scaled to the altitude at each point on the map.

   STEP 2 - Choose an area from the overhead map for conversion into a three
dimensional scene. Click the left mouse button at the location on the
overhead map which interests you.  The area to be converted will be outlined
by a black rectangle.  The observer's location and direction of view are
indicated by a notch in one side of the outline rectangle.  Move the outline
rectangle while holding down the left mouse button.  Rotate the outline
rectangle while holding down the right mouse button and moving the mouse left
or right at the bottom of the display window.  You can also make fine
adjustments to the rotation of the outline rectangle using the left and right
arrow keys.  Choose "1x" or "4x" from the "Area" menu to select the size of
the scene.  Choose "Show Scale" from the "Scale" menu to display an
indication of the horizontal and vertical scale (in kilometers) of the
selected area.

   STEP 3 - Compute and display a three dimensional wireframe preview of the
area selected from the overhead map.  Choose "Wireframe Preview" from the
"Operation" menu and a dialog box will appear giving you selection of the
detailed parameters required for the three dimensional projection.  Each of
these selections is described in the following paragraph entitled "Projection
Parameters."  Initially however, you should accept the default values by
clicking the "OK" button.  3-DEM will then draw the three dimensional
wireframe preview.  If you are not satisfied with the view, you may go back
to the "Overhead Map" and adjust the outline rectangle position or rotation. 
Or you may adjust any of the projection parameters by choosing "Wireframe
Preview" again from the Operation Menu. 

   STEP 4 - Once you are satisfied with the wireframe preview, compute and
display a three dimensional ray-traced image of the selected geographical
area.  Your ray traced image may be a projection from center eye, left eye,
or right eye viewpoints, or a red-blue projection requiring 3D glasses .
Choose "3D Ray Trace" and either "Center", "Left", "Right", or "R/B" from the
"Operation" menu and 3-DEM will then compute the selected ray-traced
projection.  Depending on the size of the scene and the speed of your
computer, this operation can take from 3 minutes to an hour.  Relax and be
patient.  Once the ray-tracing is complete, you may save the image as a
windows bitmap by choosing "Save BMP" from the File menu.


4. PROJECTION PARAMETERS

   Before 3-DEM computes a wireframe preview, you will be presented with a
dialog box for selection of detailed projection parameters.  Each of these
parameters is described here.

   LEGEND - The Legend is text which will appear at the top of your finished
three dimensional scene.  Initially, this legend is read from the DEM file
header.  Adjust the text to your own preference.

   SCENE TILT - The scene can be tilted to the observer's line of sight by a
value of 0 to 45 degrees.  A tilt of 0 indicates that the observer's line of
sight is parallel to the base of the scene.  The default value of 26 degrees
usually gives a suitable result for a foreground projection.  Use a smaller
value (12 to 16 degrees) for a background projection.  See the description of
foreground and background projections which follows. 

   VERT MAGNIFICATION - Large scale DEMs and DTMs often show very low relief
features.  Vertical magnification increases the height of surface features to
make them more visible in the three dimensional projection.  Don't hesitate
to use magnifications of 200% to 300% or more to improve the appearance of
your scene.  The default value of vertical magnification is 100%, but you
should change this value if you are not satisfied with the appearance of the
wireframe preview.

   VERT SHIFT - Occasionally, you may wish to shift the vertical position of
your projection on the screen to obtain the best scene.  Enter the number of
screen lines to be shifted, where positive values shift the image toward the
top of the window, and negative values shift the image toward the bottom. 
Normally you will not need to change vertical shift from a value of zero. 
However, this control gives you the flexibility to do so if needed.

   ILLUMINATION - The three dimensional ray tracing is computed using one
source of illumination at the azimuth and elevation angles chosen here. 
These directions are relative to the observer at all times.  Zero degrees
azimuth indicates a source directly in front of the observer, while 180
degrees azimuth indicates a source directly behind the observer.  Zero
degrees elevation indicates a source on the horizon, while 90 degrees
elevation indicates a source directly overhead.  Thus the default values of
240 degrees azimuth and 60 degrees elevation indicate an illumination source
over the left shoulder of the observer.  Experiment with these values if you
find a need to change the appearance of light and shadow in your three
dimensional projection.

   COLOR SELECTION - The color selection made here determines the
combination of colors which will be used in the final 3D scene.  The "Height"
selection provides the most realistic color by allowing  color scaling based
on terrain height as well as the direction of illumination. The "Illum"
selection provides a scene using only a single color which is shaded in
accordance with the direction of illumination.  The "R/B" and "B/R"
selections provide a 3D scene for viewing with red-blue lens 3D glasses. 
There is no standard arrangement for the red and blue lens of 3D glasses. 
Some glasses have the red lens on the right, some on the left.  Choose "R/B"
for red over the left eye or "B/R" for red over the right eye.  

   TERRAIN - Normally, terrain is a combination of mountains and plains with
lighting determined by the azimuth and elevation of the illumination source.
However, if you are developing a scene containing the ocean's surface you may
want the ocean to appear uniformly dark rather than appear as a brightly
lighted plane.  Choose "Mountain and Plain" for normal scenery, or "Island
and Ocean" for scenery including the ocean's surface.  You can also use the
"Island and Ocean" setting for scenes in which there are rivers or lakes.

   If you are developing an island and ocean scene, the shape of the shore
line may be adjusted by selection of a "Sea Level" value.  You may need to
experiment by raising or lowering the sea level to achieve the proper shore
line or river bank.  This setting is ignored for a mountain and plain scene.

   PROJECTION - "Foreground" and "Background" options are provided for the
three dimensional projection.  A foreground projection is centered at the
surface of your CRT screen and projects into the space in front of the
screen, giving an image that you can literally reach out and touch.  A
background projection is a more conventional projection behind the surface of
your CRT screen and is more suitable for large scale scenery views. 
Experiment with these options in the wireframe preview before computing the
ray-traced image.


5. COLOR ADJUSTMENTS

   PEAK AND VALLEY - After a 3D ray-traced scene has been generated, you can
adjust the colors of many features of the scene using the "Color" menu items.
Provided you have chosen "Height" color scaling from the projection
parameters, the "Peak" and "Valley" selections here provide adjustment for
the color at the highest and lowest scene elevations.  You might, for
example, choose dark colors for the lowest elevations and light colors for
the highest elevations. 3DEM will automatically calculate a smooth transition
of colors between the peaks and the valleys.  You also have the option of
adding snow cover to the peak elevations.

   OTHER COLOR ADJUSTMENTS - You also have the option of adjusting the
colors of the sky, the ocean, the edge of a foreground projection, or the
text of the scene legend.


6. MATRIX DATA FILES

   In addition to DEM and DTM data, 3-DEM will accept any topographic data
file which is organized by rows and columns of elevation data.  Choose
"Matrix" from the "File" menu, and you will be presented with a dialog box
for specification of the needed matrix parameters.

   DATA FORMAT AND OFFSET - Elevation data must be defined as signed or
unsigned 16 or 32 bit integers (INT OR UINT), or as 32 bit floating point
values (FLOAT).  Also, if the matrix data file has a header section prior to
the start of the elevation data, specify the header size here as "Offset" in
bytes.

   DATA BYTE ORDER - You must also specify the byte order of the elevation
data.  Most data files produced by machines with Intel processors will
contain "Little Endian" data in which the least significant byte is first in
the data word.  Other computers (such as the Macintosh) will produce files of
"Big Endian" data in which the most significant data byte is first in the
data word.  You will find topographic data of both types on the Internet, and
this selection gives you the option of processing both.

   MISSING DATA POINTS - Some matrix data files will fill in missing data
points with a fixed value other than zero.  Sometimes a large negative
number such as -9999 is used to distinguish missing data points.  If you
know this value, enter it here.  Otherwise enter zero.

   MATRIX DIMENSIONS - You must also specify the matrix size as number of
columns (width) and number of rows (height).  Column order may be specified
as West to East, or East to West.  Row order may be specified as North to
South, or South to North.  

   HORIZONTAL GRID SPACING - You must also specify the horizontal grid
spacing for the data matrix.  This is just the physical distance between map
grid points in the horizontal plane and usually varies from 10 meters to 500
meters or more. 

   VERTICAL UNITS - Finally, you must specify vertical units, or the unit of
measure of elevation data stored in the matrix.  Vertical units are usually
one meter or more.


7. OTHER CONSIDERATIONS

   LOADING DEMs - Full sized one degree DEMs are enormous ASCII files of up
to 10 MBytes size which must be translated byte by byte into the binary
values usable by the software.  Don't be alarmed at the time it might take to
translate a full sized DEM and compute an overhead map.  The smaller 7.5'
DEMs load much more quickly and require much less memory.  It is recommended
that you use only 7.5' DEMs if memory is short.

   LOADING DTMs - DTM files on the NASA CDROM are named as "tg00n000.img" or
"tg00s000.img" where "00n" or "00s" are degrees latitude (north or south) and
"000" is degrees west longitude.  Note that 3-DEM will also process the large
scale "te" and "tc" DTMs on the NASA CDROM.  However, these files are so
large that you should not attempt them without 16MB of RAM.  The CDROM also
contains digital photographic images of the surface of Mars named as
"mg00n000.img" or "mg00s000.img."  Don't confuse these photo files with the
digital topographic map files.  DTM files are binary files (unlike the ASCII
DEMs) and are easily digested by the 3-DEM software. 

  LOADING MATRIX FILES - You may find large matrix files which require more
system memory than you have available, or are so large that processing time
is excessive.  When this happens, you can choose to load a partial matrix
consisting of a limited group of matrix rows.  Choose a byte offset to the
start of a row of interest, and then choose a limited number of rows to be
analyzed.  The number of columns should always be equal to the full column
dimension of the matrix file.   

   SCENE AREA AND RESOLUTION - Scene projections are normally computed using
a 128 by 128 point grid of data from the overhead map.  However, if you
choose a 4X area scene and background projection, the scene is computed using
a 256 by 256 point data grid for maximum resolution of fine landscape detail.
This mode produces marvelous projections, but it requires about four times
the memory and four times as much computing time.  You might try the lower
resolution modes first before you decide to commit the time required for this
high resolution mode.

   MEMORY - More is better.  3-DEM manipulates large amounts of data in
memory.  Using virtual memory for these processes is workable, but slow.  And
you may be alarmed by the gyrations of your disk drive.  If you have 16
MBytes of memory, 3-DEM will never need virtual memory - even for one degree
DEMs.


8. SOURCES OF DATA

   DEM files are available via ftp for most of the United States and many
other areas of the globe.  Spectrum.xerox.com has a good selection of high
resolution 7.5' DEM files for ftp.  The USGS offers a large selection of 1
degree DEM files for ftp from edcftp.cr.usgs.gov.  Also try
http://sun1.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html.  Choose "1:250,000
Scale Digital Elevation Model (DEM)", and then "FTP by State". You will get a
state listing of available maps.  A good choice is Grand Canyon East in the
Arizona listing.  Be sure to download the compressed version. The
uncompressed DEM is about 10 MB!  You will need gzip to uncompress these
files.

   DTM files for Martian landscapes are available on NASA CDROM.  Volume 7
of the 14 Volume Mars Digital Image Map collection contains the Digital
Topographic Map of the entire surface of Mars. This CDROM is available for a
modest price from the National Space Science Center.  Contact
request@nssdca.gsfc.nasa.gov to request a copy of the NSSDC CDROM catalog.

   DTM files for Martian landscapes are also available on line at
http://cdwings.JPL.NASA.GOV:80/jukebox/viking/vo_2007/.  Here you will see a
large group of folders with names beginning with the letters "mg" and "tg".
Always choose a "tg" folder to get digital maps ("mg" files are photo
images).  Within each folder are a series of files with names like
"tgxxNxxx.img" or "tgxxS.xxx.img" where xxN or xxS are degrees north or south
latitude, and "xxx" is degrees west longitude.  The following files are good
choices:

	tg15S052.img	Valles Marineras area
 	tg00N067.img	Valles Marineras area
 	tg45S010.img	Crater Lohse
 	tg45S270.img	Crater Krishtofovich
 	tg45N070.img	Crater Tanais

Your best approach is to know in advance the latitude and longitude of a
feature you wish to explore, and then select the appropriate map for
downloading. 

   Matrix topographic data files are available in several formats on the
Internet.  Try http://imager.ldeo.columbia.edu/ridgembs/ne_pac/html/home.html
as a source of bathymetric data from several ocean areas of the world.  Data
which can be processed by 3-DEM are available here as *.cdf files which are
made up of a 1468 byte header followed by matrix elevation data in 32 bit
floating point format (Big Endian).  The horizontal grid spacing and number
of matrix columns and rows are given for each file, so that all the
information needed by 3-DEM is available.  

   Digital Chart of the World (DCW) data from the USGS may also be
processed by 3-DEM as matrix files.  DCW data consisting of elevation
measurements at intervals of 30 by 30 arc seconds (about 1KM) are available
for large areas of the globe for no charge via ftp from edcftp.cr.usgs.gov in
the directory pub/data/30ASDCWDEM. These files contain 16 bit elevation data
in Big Endian format.  Because these files are so large, it may be necessary
to choose a selected set of matrix rows for processing rather than the entire
file at once as described in "LOADING MATRIX FILES" above.

   Bruce M. Gittings maintains a comprehensive listing of DEM data available
world wide at http://www.geo.ed.ac.uk/home/ded.html. 

REPORTING BUGS - Please report any bugs or send any questions to
rshorne@delphi.com.  I'm also interested in any comments or suggestions for
improvement of 3-DEM.  

						Richard Horne

