TheMartianObserver / scape-terrain-simplification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

*******************************************************************
* SCAPE Terrain Simplification Software                           *
* Michael Garland and Paul Heckbert, 1994.                        *
*                                                                 *
* This software is public domain and is provided AS IS.           *
* Use it at YOUR OWN RISK.                                        *
*******************************************************************

This software is UNSUPPORTED.  We do not have the time to actively
support this software.  However, we would be happy to collect any
improvements made by others.  We have tried to make this code
palatable, but it is a long way from aesthetically pleasing.

Hopefully, you find this software interesting or useful.  If you do,
we would appreciate hearing from you.  Please send any improvements,
comments, or glowing testimonials to:

		garland@cs.cmu.edu

The algorithms used in this software are described in our technical
report on fast approximation of height fields.  You can find a copy of
this paper at:

	http://www.cs.cmu.edu/afs/cs/user/garland/public/scape/index.html


IMPORTANT NOTE: scape is now even less supported.  It will be replaced
by a new and improved program: terra.  Check the Web page above for
details.

------------------------------------------------------------------------

The programs:

	scape - The basic program.  Generates a TIN approximation for
                a given height field.  Creates a file 'out.tin'
		containing the approximation.

	glscape   - Interactive terrain simplification (SGI only).
	drawscape - Just draws an STM model (SGI only).

	Samples/ - contains some sample height fields.

[Invoke the programs without arguments to see the available arguments]

------------------------------------------------------------------------

The SCAPE tools use the STM (Simple Terrain Model) file format.  It
consists of a brief header followed by raw binary data.  The general
structure of the file is:


	STM <width> <height> <c1><c2><c3><c4><cr>
	<height data>

The height data is a sequence of unsigned 16-bit integers representing
the height values.

The four bytes c1..c4 are used to determine what byte order the
integers are stored in.

The STM-tools directory contains some simple programs for creating and
manipulating STM files.

In particular, the DEM2STM script converts USGS DEM files into STM
files.  It uses the CONVERT program by Christopher Keane to parse the
DEM file into a simpler format, and then it converts that into an STM
file.  This will NOT account for the spherical mapping of DEM data.
To properly warp the input data, look at the demtoflat and resample
programs in the STM-tools/DEMutil directory.

*PLEASE NOTE*  These converters are in no way meant to be highly
accurate or production quality.  They are merely included as quick and
dirty examples to let people experiment with USGS DEM data.

------------------------------------------------------------------------

The 'glscape' program allows you to watch the process of terrain
simplification.  The keys for performing operations are:

Mesh view (the initial window):

	g - select multiple sites (number specified on command line)
	s - select a single site
	r - bring up surface view
	q - quit scape program

Surface view:

	left button drag - rotate terrain around
	middle button drag - move light when in lit-surface mode

	t - toggle display of triangle mesh
	f - toggle display between pseudocolor and lit-surface modes
	v - toggle display of surface texture
	x - show actual surface texture rather than approximate texture

	g - select multiple sites
	s - select a single site
	q - quit surface view

------------------------------------------------------------------------

The SCAPE system is based on algorithms described in our paper:

	"Fast Polygonal Approximation of Terrains and Height Fields"
	by Michael Garland and Paul Heckbert
	(Technical Report CMU-CS-95-181)

The results shown in that paper were generated by the SCAPE software.
However, there are some differences between this software and what is
described in the paper.

	(1) The unoptimized algorithms which we discuss are not
	supported by SCAPE.  Only the optimized algorithms
	(III and IV from the paper) are implemented here.

	(2) Memory usage for the heap in SCAPE is a bit different.  In
	the paper, we say that the memory necessary for the heap is
	proportional to the number of triangles.  This is not strictly
	true in SCAPE.  To avoid large memory copies during the
	simplification process, SCAPE preallocates a very large heap.
	SCAPE will only actually use the amount (as given in the
	paper) which is proportional to the number of triangles.  On
	systems which support virtual memory, this does not incur any
	penalty: the unused portions of the heap are never touched and
	remain either unallocated or paged out on the disk.

About


Languages

Language:C 81.6%Language:C++ 16.8%Language:Makefile 1.0%Language:Perl 0.5%Language:Shell 0.1%