Skip to content

Commit

Permalink
when the zoom scale larger than 400 we switch the clip distance in th…
Browse files Browse the repository at this point in the history
…e globe view
  • Loading branch information
yuanho committed Feb 26, 2024
1 parent 6802985 commit 90a4e44
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/ucar/unidata/view/geoloc/GlobeDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@

import java.rmi.RemoteException;

import java.util.Arrays;
import java.util.Iterator;

import javax.media.j3d.GraphicsConfigTemplate3D;
Expand Down Expand Up @@ -180,6 +181,7 @@ public class GlobeDisplay extends NavigatedDisplay {
/** Earth Radius (m) */
public static final double EARTH_RADIUS = 6371229.;

private double[] savedProjectionMatrix = null;
/**
* Constructs a new GlobeDisplay.
*
Expand Down Expand Up @@ -545,6 +547,28 @@ private void setSpatialScalarMaps()
}

}
/**
* Zoom in on the display
*
* @param scale x zoom factor
*
*
* ( > 1 = zoom in, 1 > zoom > 0 = zoom out). using
* 2.0 and .5 seems to work well.
*/
public void resetClipDistance(double scale) {

//System.out.println("Current zoom = " +scale);
if(scale > 400) {
setClipDistanceFront(CLIP_FRONT_DEFAULT);
setClipDistanceBack(CLIP_BACK_DEFAULT);
}
else {
setClipDistanceFront(super.defaultClipDistanceFront);
setClipDistanceBack(super.defaultClipDistanceBack);
}
// System.out.println("Scale = " + getView().getFrameNumber() + " Front = " + getClipDistanceFront() + "Rear = " + getClipDistanceBack());
}

/**
* Set the map area to be displayed in the box. Does nothing at
Expand Down

0 comments on commit 90a4e44

Please sign in to comment.