本文整理汇总了Java中gov.nasa.worldwind.View.setEyePosition方法的典型用法代码示例。如果您正苦于以下问题:Java View.setEyePosition方法的具体用法?Java View.setEyePosition怎么用?Java View.setEyePosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.worldwind.View
的用法示例。
在下文中一共展示了View.setEyePosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: gotoProduct
import gov.nasa.worldwind.View; //导入方法依赖的package包/类
private void gotoProduct(final Product product) {
if (product == null) return;
final View theView = getWwd().getView();
final Position origPos = theView.getEyePosition();
final GeoCoding geoCoding = product.getSceneGeoCoding();
if (geoCoding != null && origPos != null) {
final GeoPos centre = product.getSceneGeoCoding().getGeoPos(new PixelPos(product.getSceneRasterWidth() / 2,
product.getSceneRasterHeight() / 2), null);
centre.normalize();
theView.setEyePosition(Position.fromDegrees(centre.getLat(), centre.getLon(), origPos.getElevation()));
}
}
示例2: goTo
import gov.nasa.worldwind.View; //导入方法依赖的package包/类
/**
* Move to a given location.
*
* @param lon
* the longitude.
* @param lat
* the latitude.
* @param elev
* the eye elevation.
* @param azimuth
* if supplied, the map is rotated to follow that angle.
* @param animate
* if <code>true</code>, it animates to the position.
*/
public synchronized Position goTo( Double lon, Double lat, Double elev, Double azimuth, boolean animate ) {
View view = getWwd().getView();
view.stopAnimations();
view.stopMovement();
Position eyePosition;
if (lon == null || lat == null) {
Position currentEyePosition = wwd.getView().getCurrentEyePosition();
if (currentEyePosition != null) {
lat = currentEyePosition.latitude.degrees;
lon = currentEyePosition.longitude.degrees;
} else {
return null;
}
}
if (elev == null) {
// use the current
elev = wwd.getView().getCurrentEyePosition().getAltitude();
}
if (Double.isNaN(elev)) {
if (!Double.isNaN(lastElevation)) {
elev = lastElevation;
} else {
elev = NwwUtilities.DEFAULT_ELEV;
}
}
eyePosition = NwwUtilities.toPosition(lat, lon, elev);
if (animate) {
view.goTo(eyePosition, elev);
} else {
view.setEyePosition(eyePosition);
}
if (azimuth != null) {
Angle heading = Angle.fromDegrees(azimuth);
view.setHeading(heading);
}
lastElevation = elev;
return eyePosition;
}