Skip to content

Commit

Permalink
previous changes of scaleZ to zoom to the street level can cause the …
Browse files Browse the repository at this point in the history
…object distortion. The new approach is to change

the clip distance, in this approach both map view and globe view can be zoom to very details.
  • Loading branch information
yuanho committed Feb 26, 2024
1 parent 7918929 commit 9dad4b7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/ucar/visad/display/DisplayMaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@

import java.rmi.RemoteException;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.*;

import javax.swing.BoxLayout;
import javax.swing.JPanel;
Expand Down Expand Up @@ -1304,8 +1301,8 @@ protected void handleMouseWheelMoved(java.awt.event.MouseWheelEvent e) {
* 2.0 and .5 seems to work well.
*/
public void zoom(double factor) {
double factorZ = 1.0 + (factor - 1.0) * (myAspect[2]/myAspect[0]);
zoom(factor, factor, factorZ);
//double factorZ = 1.0 + (factor - 1.0) * (myAspect[2]/myAspect[0]);
zoom(factor, factor, factor);

}

Expand All @@ -1328,7 +1325,13 @@ public void zoom(double xfactor, double yfactor, double zfactor) {
double[] currentMatrix = getProjectionMatrix();
scaleMatrix = getMouseBehavior().multiply_matrix(scaleMatrix,
currentMatrix);
double[] trans = { 0.0, 0.0, 0.0 };
double[] rot = { 0.0, 0.0, 0.0 };
double[] scale = { 0.0, 0.0, 0.0 };
getMouseBehavior().instance_unmake_matrix(rot, scale, trans,
scaleMatrix);

resetClipDistance( scale[0]);
try {
setProjectionMatrix(scaleMatrix);
// setProjectionMatrix(xscaleMatrix);
Expand All @@ -1338,6 +1341,9 @@ public void zoom(double xfactor, double yfactor, double zfactor) {

}

public void resetClipDistance(double scale){

}

/**
* Get the scaling factor for probes and such. The scaling is
Expand Down

0 comments on commit 9dad4b7

Please sign in to comment.