3d image display

Bill Brown brown at zorro.cecer.army.mil
Thu May 13 12:33:02 EDT 1993


Greg,


When using lat-long data with d.3d in GRASS4.0, the
initial default vertical exag. is way off because d.3d assumed that
the vertical units are the same as the east & north units.  This works
fine with UTM data and elevation in meters, but with lat-long data,
meters in an elevation file get turned into "degrees above the surface".
If this doesn't make sense, please just take my word for it.

You should be able to get a decent view if you start out with an 
exag factor in the neighborhood of .001, eye position height around 50-100,
and center of view height at 0. Even these "defaults" will vary depending
upon the size of the region you're looking at.

That problem was fixed in GRASS4.1, but if you don't want to wait until
you have 4.1 installed, here's a way to fix the default exaggeration:


In the d.3d src directory (src/display/d.3d), there is a file called
get_inputs.c that creates initial settings.  In the function
get_defaults(), I just added these two lines:

        while((exag * max - exag * min) > (window.east - window.west)/5.)
            exag /= 5.;

I put them right after the line:

        exag = 2.0 ;

in the defaults: goto block.  (I'd tell you the line number, but
there have been a few other minor changes in this file for GRASS4.1,
so the line number would be different in your version.)

This fix has the effect of insuring that the initial elevation range
is scaled to be between 1/5th and 1/25th as high as the data is wide.

Note that all units displayed by d.3d are in degrees, so if you want to
set a precise resolution in minutes & seconds you'll have to convert
to decimal first.

Good luck.

Bill Brown
brown at zorro.cecer.army.mil





More information about the grass-user mailing list