3D

Bill Brown brown at zorro.cecer.army.mil
Tue Sep 22 15:56:13 EDT 1992


In response to Joyce Nagle, CRREL. 

It sounds like you are using lat-long data with d.3d, in which case the
initial default vertical exag. is way off because d.3d assumes 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.

If you want to put a "fix" in your d.3d code to give you better initial
defaults, this is what I did:


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,
to use a new 3d.view file writing routine from the GRASS gis library,
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.

OK, now for the commercial break:
If you have access to a Silicon Graphics workstation (even an Indigo),
we have a brand new version of SG3d on moon just begging for people to
use it.  It makes positioning in 3d about 100 times easier than with
d.3d, allows you to drape vector files over the surface and place a 
lighting source for shading.  See the latest issue of GrassClippings
for more information.

Good luck.

Bill Brown
brown at zorro.cecer.army.mil




More information about the grass-user mailing list