------------------------------------------------------------------------------- TopoVista - version 3.0 ------------------------------------------------------------------------------- Will Evans and Gregg Townsend Department of Computer Science, The University of Arizona topovista@cs.arizona.edu http://www.cs.arizona.edu/topovista/ ------------------------------------------------------------------------------- TopoVista uses a RTIN (Right Triangular Irregular Network) hierarchy to provide an interactive 3-D perspective view of digital elevation models. Each view is based on an approximation to the original model. The approximation is sensitive to the current eye position, so that portions of the terrain that are close to the eye are more closely approximated than those farther away. This reduces the number of triangles that need to be rendered for each frame and makes interactive response possible. TopoVista reads a U.S. Geological Survey DEM file to obtain an elevation model. The elevation model can be false colored by elevation or colored using an image from a PPM file -- an optional argument to the TopoVista program. Any PPM image will work. The image will be stretched to fit the elevation model extent unless it was created from a U.S. Geological Survey CTG file using the program ctg2ppm (see Other Functions below) in which case it will be correctly aligned to the elevation model. Paths (such as GPS routes or tracks) can be painted on the surface by including a file that lists the latitude, longitude (decimal degrees) of points on the path. Each line of the file is assumed to contain (as the last two numbers on the line) the coordinates of one point. The program comes with a sample digital elevation model and PPM file covering Mount St. Helens (before and after). To try out the program, build it (see the INSTALL file) and then type: topo helens1.dem hoquiam.ppm The program will print the dimensions of the data files it's reading: helens1 size 327 x 467, dimensions 10 x 14 km, elevations 662 to 2951 m. hoquiam size 773 x 558. Hierarchy uses 1826858 bytes. then three windows (the Control window, Overhead window, and Perspective window) will appear. If you're in the Overhead (2-D, relief) window, dragging the mouse around with the left button down changes your eye position. Dragging with the right mouse button down changes where you're looking. (You can even drag to outside the window.) The lines (shaped like a V) in the Overhead window indicate your field of view. The little black dot near the center is the point you're looking at. If you click the middle mouse button, topo prints latitude, longitude, elevation, and, if available from the PPM file, the Land Use Land Cover designation for the area under the cursor: -122 13' 5.567 46 9' 5.153 elev 1043.000m Evergreen Forest Land The Control window (that's the one with all the text) has various options to play with. You can left or right click on the options and they change value, or you can type the letter in brackets (in any window) to do the same thing. [C]olor by It cycles through alternative colorings of the terrain: PPM file coloring In order to have this option, you must give the program at least one PPM file. Each PPM file results in one file coloring alternative. False coloring based on elevation Some sort of metallic lead-like color Error[>0<] As you probably guessed, the program approximates the surface using a set of triangles. It changes the approximation when you change your position or the point you're looking at. Parts of the surface that are far away from you are approximated less precisely than parts that are closer. To get an idea of how the approximation works, imagine a flat triangular sheet whose three corners are nailed to the surface of the earth. The sheet either lies above the surface or below the surface (it's flat, the earth is bumpy). The error of the triangle is the maximum vertical distance from the sheet to the earth's surface. If this distance is too big we should use two triangles in place of the current one -- the current one is too "coarse", it should be "refined". Of course, this only applies if the triangle is in your Field of View (FOV). The "Error[>0<]" option allows you to say how closely the triangles should approximate the surface. Initially, it is set so that a triangle at a distance of 1 kilometer from you whose surface is everywhere within 1 meter of the true surface is close enough. Error is a ratio. So triangles at a distance of 500 meters must be within 0.5 meters of the true surface, etc. The ">" ("<") key increases (decreases) the allowed error; the approximation gets worse (better). The "0" key makes the error 0. Pressing it again restores the error to what it was before. Distance[+-] In addition to the error criteria, the program also insists that every triangle (in the FOV) within distance 700m (initially) has size 1 (is at the finest resolution). Between distance 700m and 1400m, triangles are allowed to have size 2; between 1400m and 2100m, size 3; etc. The "Distance[+-]" option lets you change the 700m "drop-off" value. [E]ye Up means the perspective view is from a position far above the surface of the earth. Down means you're walking on the surface. Don't be shocked if you can't see anything when you're down on the surface. You may be looking at a cliff, or *through* a cliff. PageUp and PageDown also control the eye. [2]d Mesh The triangles used to approximate the surface can be shown in the top down window (the 2-D window) by toggling this option. 2-D Mesh has 3 modes Off, On, and FOV Fill. [3]d Mesh shows the triangles in the perspective view. Only 2 modes: Off and On. [V]ert.Exag. The program multiplies all height values by this amount. "v" increases and "V" decreases this value. [S]mooth Should the program calculate vertex normals and do smooth shading or should it draw flat triangles? [B]ackface Cull On means triangles with a surface normal pointing away from you are not drawn. [F]ov Cull On means triangles outside your Field of View are not drawn. [P]rint [p]s Press "p" and the program will output a Postscript file called .ps where is the name of the current DEM file (the string between the last "/" (or "\") and the first "." in the DEM filename). This functionality is brought to you by Mark J. Kilgard http://reality.sgi.com/opengl/tips/Feedback.html It produces high-resolution postscript, not a screen dump. Be prepared for a huge file if your current view has many triangles in it. Press "P" and the program will output a STL file called .stl. STL files are a common input format for 3D printers. I wish I had one. [Q]uit when you just can't take any more. There are a few options that aren't mentioned in the Control window. You can move and rotate in little steps using the arrow keys or in big steps using shift + arrow keys. You can move forward or backward in even bigger steps by pressing the Space bar or Backspace key. Command line options: -d distance threshold (default=700.000000) -e error threshold (default=0.001000) -t time the hierarchy and surface creation (default=0) -v vertical scaling factor (default=1.000000) ------------------------------------------------------------------------------ OTHER FUNCTIONS ------------------------------------------------------------------------------ 1) How do you get more digital elevation models to look at? Go to http://edcwww.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html to get some 1 degree x 1 degree DEMs (they're called 1:250,000-Scale Digital Elevation Model). You can also use 7.5 minute DEMs if you can find them in DEM format. They are now distributed by the USGS in SDTS format. You can convert SDTS format to DEM format using the sdts2dem program located in the f123app subdirectory of http://www.cs.arizona.edu/topovista/f123.zip. 2) How do you get ppm files to color the digital elevation models? Go to http://edcwww.cr.usgs.gov/pub/data/LULC/250K/ to get Composite Theme Grid (CTG) data. It's under 1:250,000-Scale and 1:100,000-Scale Land Use and Land Cover (LULC). Get the file called 'grid_cell' for whatever area you'd like. The files for Arizona are at http://edcwww.cr.usgs.gov/glis/hyper/guide/1_250_lulcfig/states/AZ.html Now translate the CTG file into a PPM file using the program ctg2ppm. This program takes a CTG file and produces a PPM file. (Yes, it's a regular PPM file; you can view it using xv. It just has some latitude/longitude and legend stuff in the comments at the beginning.) The colors assigned by the program ctg2ppm to the various usage codes can be found in the file ctg2ppm.c. Assuming you have a DEM file with elevation data for the same area covered by the PPM file, you can just run: topo demfile ppmfile If the ppmfile has no latitude/longitude information (for example, it's just a picture you want draped over the terrain) then the program assumes that its extent matches the demfile extent.