本文整理汇总了Java中gov.nasa.worldwind.view.orbit.OrbitView.getZoom方法的典型用法代码示例。如果您正苦于以下问题:Java OrbitView.getZoom方法的具体用法?Java OrbitView.getZoom怎么用?Java OrbitView.getZoom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.worldwind.view.orbit.OrbitView
的用法示例。
在下文中一共展示了OrbitView.getZoom方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPlace
import gov.nasa.worldwind.view.orbit.OrbitView; //导入方法依赖的package包/类
@Override
protected MapPlace createPlace(MapPlace root, String text, double x,
double y, double zoom) {
WorldWindowGLCanvas wwd = ((WWMap) map).wwd;
OrbitView view = (OrbitView) wwd.getView();
zoom = ((WWMap) map).getGMAZoom();
Position pos = view.getCenterPosition();
double pitch = view.getPitch().degrees;
double heading = view.getHeading().degrees;
double zoom2 = view.getZoom();
double ve = wwd.getSceneController().getVerticalExaggeration();
return new WWMapPlace(
root,
text,
pos.getLongitude().degrees,
pos.getLatitude().degrees,
zoom,
pitch,
heading,
zoom2,
ve);
}
示例2: setupFirstPersonView
import gov.nasa.worldwind.view.orbit.OrbitView; //导入方法依赖的package包/类
/**
* Setup the view to a first person mode (zoom = 0)
*
* @param view the orbit view to set into a first person view.
*/
protected void setupFirstPersonView(OrbitView view)
{
if (view.getZoom() == 0) // already in first person mode
return;
Vec4 eyePoint = view.getEyePoint();
// Center pos at eye pos
Position centerPosition = wwd.getModel().getGlobe().computePositionFromPoint(eyePoint);
// Compute pitch and heading relative to center position
Vec4 normal = wwd.getModel().getGlobe().computeSurfaceNormalAtLocation(centerPosition.getLatitude(),
centerPosition.getLongitude());
Vec4 north = wwd.getModel().getGlobe().computeNorthPointingTangentAtLocation(centerPosition.getLatitude(),
centerPosition.getLongitude());
// Pitch
view.setPitch(Angle.POS180.subtract(view.getForwardVector().angleBetween3(normal)));
// Heading
Vec4 perpendicular = view.getForwardVector().perpendicularTo3(normal);
Angle heading = perpendicular.angleBetween3(north);
double direction = Math.signum(-normal.cross3(north).dot3(perpendicular));
view.setHeading(heading.multiply(direction));
// Zoom
view.setZoom(0);
// Center pos
view.setCenterPosition(centerPosition);
}
示例3: computeNewZoom
import gov.nasa.worldwind.view.orbit.OrbitView; //导入方法依赖的package包/类
protected double computeNewZoom(OrbitView view, double amount)
{
double coeff = 0.05;
double change = coeff * amount;
double logZoom = view.getZoom() != 0 ? Math.log(view.getZoom()) : 0;
// Zoom changes are treated as logarithmic values. This accomplishes two things:
// 1) Zooming is slow near the globe, and fast at great distances.
// 2) Zooming in then immediately zooming out returns the viewer to the same zoom value.
return Math.exp(logZoom + change);
}
示例4: resetOrbitView
import gov.nasa.worldwind.view.orbit.OrbitView; //导入方法依赖的package包/类
/**
* Reset the view to an orbit view state if in first person mode (zoom = 0)
*
* @param view the orbit view to reset
*/
protected void resetOrbitView(OrbitView view)
{
if (view.getZoom() > 0) // already in orbit view mode
return;
// Find out where on the terrain the eye is looking at in the viewport center
// TODO: if no terrain is found in the viewport center, iterate toward viewport bottom until it is found
Vec4 centerPoint = computeSurfacePoint(view, view.getHeading(), view.getPitch());
// Reset the orbit view center point heading, pitch and zoom
if (centerPoint != null)
{
Vec4 eyePoint = view.getEyePoint();
// Center pos on terrain surface
Position centerPosition = wwd.getModel().getGlobe().computePositionFromPoint(centerPoint);
// Compute pitch and heading relative to center position
Vec4 normal = wwd.getModel().getGlobe().computeSurfaceNormalAtLocation(centerPosition.getLatitude(),
centerPosition.getLongitude());
Vec4 north = wwd.getModel().getGlobe().computeNorthPointingTangentAtLocation(centerPosition.getLatitude(),
centerPosition.getLongitude());
// Pitch
view.setPitch(Angle.POS180.subtract(view.getForwardVector().angleBetween3(normal)));
// Heading
Vec4 perpendicular = view.getForwardVector().perpendicularTo3(normal);
Angle heading = perpendicular.angleBetween3(north);
double direction = Math.signum(-normal.cross3(north).dot3(perpendicular));
view.setHeading(heading.multiply(direction));
// Zoom
view.setZoom(eyePoint.distanceTo3(centerPoint));
// Center pos
view.setCenterPosition(centerPosition);
}
}
示例5: zoomToWESN
import gov.nasa.worldwind.view.orbit.OrbitView; //导入方法依赖的package包/类
public void zoomToWESN(double[] wesn) {
double delta_x = wesn[1] - wesn[0];
double delta_y = wesn[3] - wesn[2];
double earthRadius = wwd.getModel().getGlobe().getRadius();
double horizDistance = earthRadius * delta_x;
double vertDistance = earthRadius * delta_y;
// Form a triangle consisting of the longest distance on the ground and the ray from the eye to the center point
// The ray from the eye to the midpoint on the ground bisects the FOV
double distance = Math.max(horizDistance, vertDistance) / 64;
double altitude = distance / Math.tan(wwd.getView().getFieldOfView().radians / 2);
LatLon latlon = LatLon.fromDegrees(wesn[2] + delta_y / 2, wesn[0] + delta_x / 2);
Position pos = new Position(latlon, altitude);
final OrbitView view = (OrbitView) wwd.getView();
Position oldPos = view.getEyePosition();
view.setEyePosition(pos);
Position center = view.getCenterPosition();
Angle heading = view.getHeading();
Angle pitch = view.getPitch();
double zoom = view.getZoom();
view.setEyePosition(oldPos);
FlyToOrbitViewAnimator fto =
FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(
view,
view.getCenterPosition(), center,
view.getHeading(), heading,
view.getPitch(), pitch,
view.getZoom(), zoom,
5000, WorldWind.CONSTANT); //was true
view.addAnimator(fto);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
((MapApp)getApp()).getFrame().toFront();
view.firePropertyChange(AVKey.VIEW, null, view);
}
});
}