示例#1
0
 public void calculate() {
   double cx = control.getDouble("camera x");
   double cy = control.getDouble("camera y");
   double cz = control.getDouble("camera z");
   double fx = control.getDouble("camera focus x");
   double fy = control.getDouble("camera focus y");
   double fz = control.getDouble("camera focus z");
   double d = control.getDouble("screen distance");
   double r = control.getDouble("rotation");
   Camera camera = (Camera) panel.getCamera();
   if (cx != camera.getX() || cy != camera.getY() || cz != camera.getZ()) {
     camera.setXYZ(cx, cy, cz);
     control.setValue("camera azimuth", camera.getAzimuth());
     control.setValue("camera altitude", camera.getAltitude());
   } else {
     double altitude = control.getDouble("camera altitude");
     double azimuth = control.getDouble("camera azimuth");
     camera.setAzimuthAndAltitude(azimuth, altitude);
     control.setValue("camera x", camera.getX());
     control.setValue("camera y", camera.getY());
     control.setValue("camera z", camera.getZ());
   }
   camera.setFocusXYZ(fx, fy, fz);
   camera.setDistanceToScreen(d);
   camera.setRotation(r);
   panel.render();
 }
示例#2
0
 public void updateValues() {
   Camera camera = (Camera) panel.getCamera();
   control.setValue("camera x", camera.getX());
   control.setValue("camera y", camera.getY());
   control.setValue("camera z", camera.getZ());
   control.setValue("camera focus x", camera.getFocusX());
   control.setValue("camera focus y", camera.getFocusY());
   control.setValue("camera focus z", camera.getFocusZ());
   control.setValue("camera altitude", camera.getAltitude());
   control.setValue("camera azimuth", camera.getAzimuth());
   control.setValue("screen distance", camera.getDistanceToScreen());
   control.setValue("rotation", camera.getRotation());
 }