OPERATING INSTRUCTIONS FOR 3-DEM RAYTRACE SOFTWARE (Version 3.0) 1. CONCEPT OF OPERATION 3-DEM will produce ray traced landscape scenes and flyby animations from USGS Digital Elevation Model (DEM) files, USGS Digital Chart of the World (DCW) 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 - 3D RAY TRACING 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, DCW, DTM, or Data Matrix file and draw an overhead map of scaled altitude data. Select the file to be loaded into 3-DEM from the "File" menu. If the file is of the correct type, 3-DEM will 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 "Blue/Red" 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. SEQUENCE OF OPERATIONS - FLYBY ANIMATION A flyby animation is a stored series of 3D scenes (or frames) which are played back rapidly in sequence to produce the appearance of a flyby. To produce a flyby animation you must perform four operations in sequence with the 3-DEM software as follows: STEP 1 - Load a new DEM, DCW, DTM, or Data Matrix file and draw an overhead map of scaled altitude data. Select the file to be loaded into 3-DEM from the "File" menu. If the file is of the correct type, 3-DEM will draw an overhead map of the entire geographical area with color scaled to the altitude at each point on the map. STEP 2 - Choose a flyby path across the overhead map. Choose "Flyby Map" from the "Operation" menu to initialize a flyby path. The flyby starting position and observer's area of view are outlined by a black rectangle. The end of the flyby path is shown by the "x" marker. Click and drag the center of the observer's rectangle to the desired start of the flyby path. Then click and drag the "x" marker to the desired end of the flyby path. 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. The entire length of the flyby path will be drawn as an arc from the chosen starting position to the chosen ending position. STEP 3 - Compute and display wireframe previews of selected animation frames. Choose "Flyby Preview" from the "Operation" menu and a dialog box will appear giving you selection of the detailed parameters required for the 3D projection of individual flyby frames. An individual frame is selected as the "Current Frame" in the "Frame View" group of this dialog box. Each preview selection 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 of the current frame. You should preview several frames along the path in this way to be certain that the flyby path is acceptable. You also have the option at this point of ray tracing individual frames in order to check the color and shading to be used in the final animation. If you are not satisfied with any frame along the path, you may go back to the "Flyby Map" and adjust the flyby path. Or you may adjust any of the projection parameters by choosing "Flyby Preview" again. STEP 4 - Once you are satisfied with wireframe previews of several frames along the flyby path, compute and store the complete flyby animation. Choose "Flyby Raytrace - Entire Path" from the operation menu. You will be requested to give a filename for the animation, and then 3-DEM will proceed to compute a ray traced image of each frame in sequence. The animation will be stored in the specified file as a sequence of compressed images. The size of an animation file can be very large, depending on the frame size and total number of frames. Below is a comparison of file sizes for a 50 frame animation from the US Grand Canyon DEM at low color resolution. Size 480 x 360 Size 640 x 480 Height Shading 2.7 MByte 4.2 MByte Illum Shading 3.6 MByte 5.4 MByte R/B Shading 4.0 MByte 6.1 MByte Fifty frames is a practical minimum flyby length and, for 480 x 360 size, can be computed in about 2 hours with a 486 DX2 computer. Animations of three or four times this length are much more spectacular but take much longer to compute. If you are lucky enough to have a fast Pentium processor your computing time will be significantly reduced. When selecting a flyby path, keep the path length to a reasonable distance. Smoother animations result from short distances between animation frames. Also, a flyby which covers 500 Km in 10 seconds will not be very realistic. If your animations appear jumpy, reduce the distance between animation frames Once a flyby animation has been completed and stored in a file, it may be played back by choosing "Open Flyby" from the "Flyby" menu. Repeated playback of the file may then be made by choosing "Play Flyby" from the "Flyby" menu. 5. DETAILED 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. Legends in Flyby are printed at the bottom of the screen. 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 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. FLYBY ALTITUDE - The flyby altitude can be adjusted to improve the appearance of the flyby. The initial value will be a high altitude above the landscape surface. Lower values may be chosen depending on the terrain. It is best not to set altitude lower than the maximum terrain altitude given by the overhead map scale. Otherwise you may fly into a mountain peak. Flyby altitude and scene tilt are the two most important factors in the appearance of a flyby animation. Experiment with these two values to obtain the best flyby appearance. In general, your flyby will appear more realistic if you increase the tilt to the point that no sky is visible and the view of the surface fills the frame. 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. This effect is best seen using a Blue/Red projection and 3D glasses. 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. FRAME VIEW - The "Current Frame" for flyby preview and "Number of Frames" for the entire flyby animation may be selected here. Fifty frames is a practical minimum number for an enjoyable flyby. The maximum number of frames is determined by your disk space and the time you are willing to spend computing the animation. FRAME SIZE - Animations may be sized as 480 x 360 or 640 x 480. Make your selection here. The smaller frame size takes less time to compute, and generally plays back at a higher speed. Experiment with these selections and pick the size you prefer. RESOLUTION - Animation frames may be produced in either high or low color resolution. High resolution is best, but produces the largest sized animation files. Low resolution provides only 1/2 the number of individual colors, but reduces the size of the flyby animation file. Experiment with high and low color resolution when you preview flyby frames. The choice is often determined by the nature of the terrain. 6. 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. 3-DEM 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. 7. USGS DIGITAL ELEVATION MODEL (DEM) FILES 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://edcwww.cr.usgs.gov/doc/edchome/datasets/edcdata.html. Choose either 7.5 Min DEMs or 1 Degree DEMs under the Topographic Data selection. 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 decompress these files. Bruce M. Gittings maintains a comprehensive listing of DEM data available world wide at http://www.geo.ed.ac.uk/home/ded.html. USING DEM FILES - Choose Open "USGS DEM" from the "File" menu to select a DEM file. DEM files must be named *.dem to be recognized by the program. 8. USGS DIGITAL CHART OF THE WORLD (DCW) FILES SOURCES OF DATA - Digital Chart of the World (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 cost via ftp from edcftp.cr.usgs.gov in the directory pub/data/30ASDCWDEM. Also try http://edcwww.cr.usgs.gov/doc/edchome/datasets/edcdata.html and choose DCW DEMs from the Topographic Data selection. USING DCW FILES - Choose Open "USGS DCW" from the "File" menu to select a DCW file. DCW files must be named *.bil, and have an associated header file named *.hdr. The header file contains information about the number of rows and columns, the latitude and longitude limits etc. If the header file is present, 3-DEM will read this information from it. If the header file is not present, you will have to enter this information yourself in the "DCW File Parameters" dialog box which will appear. LATITUDE - Enter here the latitude of the South Edge and the North Edge of the entire DCW file. North latitudes are positive and south latitudes are negative. LONGITUDE - Enter here the longitude of the West Edge and the East Edge of the entire DCW file. West latitudes are negative and east latitudes are positive. MATRIX DIMENSIONS - Enter here the number of rows and columns of the entire DCW file. VERTICAL UNITS - Enter here the unit of measure of the amplitude data contained in the DCW file (meters or feet). MISSING DATA - Some DCW 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. SCENE LATITUDE AND LONGITUDE - After you enter DCW file parameters, another dialog box will prompt you for the latitude and longitude of the area within the DCW which you wish to view. Use the sliders provided to select a center latitude and longitude for your scene. 9. NASA MARS VIKING ORBITER DIGITAL TERRAIN MODEL (DTM) FILES SOURCES OF DATA - 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 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. 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). The following files are good choices: tg15S067.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. 10. MATRIX DATA FILES SOURCES OF DATA - Matrix data files are available 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. USING MATRIX DATA FILES - 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 - 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 the unit of measure of elevation data stored in the data matrix (meters or feet). OTHER CONSIDERATIONS - 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. 11. REPORTING BUGS Please report any bugs or send any questions to me at rshorne@mnsinc.com or rshorne@delphi.com. I'm also interested in any comments or suggestions for improvement of 3-DEM. Richard Horne