/** * Set the scale * * @param baseScale the base scale * @throws RemoteException On badness * @throws VisADException On badness */ public void setScale(double baseScale) throws VisADException, RemoteException { this.baseScale = baseScale; if (getDisplayMaster() == null) { return; } ProjectionControl pcontrol = getDisplayMaster().getDisplay().getProjectionControl(); if (pcontrol == null) { return; } double[] matrix = pcontrol.getMatrix(); double[] rot = new double[3]; double[] scale = new double[1]; double[] trans = new double[3]; MouseBehaviorJ3D.unmake_matrix(rot, scale, trans, matrix); // System.err.println("scale:" + scale[0]); // It seems like dividing by 15 gives us good results zoom = (float) scale[0] / (float) baseScale; }