Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

better method for setting Cartesian aspect ratios

There are now two methods in ProjectionControl for setting
aspect ratio:

  public void setAspect(double[] aspect)
         throws VisADException, RemoteException;

  public void setAspect2(double[] aspect)
         throws VisADException, RemoteException;

The first is the same implementation that has been available
previously.  This has the negative affect of squashing text
and other line graphics, and making unrealistic normals for
shading.

The second eliminates the negative affects.  Note however it
is only appropriate for displays with ScalarMaps to XAxis,
YAxis and ZAxis.  Displays based on spherical and other non-
Cartesian spatial coordinates are unaffected by setAspect2().

I have changed Test57.java and Test58.java in visad/examples
to use setAspect2().  Note that Test57.java actually combines
both methods:

      control.setAspect2(new double[] {2.0, 1.0, 0.5});
      control.setAspect(new double[] {0.5, 0.5, 0.5});

Passing aspect numbers larger than 1.0 to setAspect2() avoids
text collisions in axis scales, then passing three identical
values (i.e., 0.5) to setAspect() scales the scene to fit in
the window.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690