TerraGear Documentation: Difference between revisions

Jump to navigation Jump to search
Line 41: Line 41:


hgtfit is responsible for taking the raw heightfield data for one bucket, and picking the most important points to generate a triangle mesh.  It uses [http://mgarland.org/archive/cmu/scape/terra.html Terra] to perform the work.  The output is not a triangulation, but rather a list of nodes that can be fed to a triangulation routine.  The quality of FlightGear's terrain is directly related to what parameters are fed into hgtfit.
hgtfit is responsible for taking the raw heightfield data for one bucket, and picking the most important points to generate a triangle mesh.  It uses [http://mgarland.org/archive/cmu/scape/terra.html Terra] to perform the work.  The output is not a triangulation, but rather a list of nodes that can be fed to a triangulation routine.  The quality of FlightGear's terrain is directly related to what parameters are fed into hgtfit.
==== command options ====
hgtfit [options] <file | path>
{| class="wikitable"
|-
! Option !! Default !! Description
|-
| -m ''or'' --minnodes||50||smallest number of nodes to produce.  For a mostly flat tile, more nodes are wasteful.
|-
| -x ''or'' --maxnodes||1000||largest number of nodes to produce.  For a very complex tile, limiting this will reduce the detail of the resulting mesh.
|-
| -e ''or'' --maxerror||40||While picking points, and we have at least minnodes, but not yet maxnodes, the mesh will be completed if any of the remaining points maximum elevation error drops below this value.
|}
As you can see, the default parameters are pretty conservative.  At most, we will output 1,000 nodes.  The input data for SRTM-1 contains 202,500 nodes, so we are only keeping 0.5% of the source data (or for SRTM-3, with 22,500 nodes, we keep ~5% of the source data) 
For my experiments, I've increased maxnodes to 20,000, and decreased max error to 10 meters, and didn't see a major frame rate hit).
If you consider the number of nodes added when using detailed landclass, it's unfortunate that the height lookup for these points will be based on such an inaccurate mesh.<br />
<br />


=== ogr-decode ===
=== ogr-decode ===
129

edits

Navigation menu