本文整理汇总了Java中gov.nasa.worldwind.geom.Box类的典型用法代码示例。如果您正苦于以下问题:Java Box类的具体用法?Java Box怎么用?Java Box使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Box类属于gov.nasa.worldwind.geom包,在下文中一共展示了Box类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawBoundingVolumes
import gov.nasa.worldwind.geom.Box; //导入依赖的package包/类
protected void drawBoundingVolumes(DrawContext dc, ArrayList<TextureTile> tiles)
{
GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.
float[] previousColor = new float[4];
gl.glGetFloatv(GL2.GL_CURRENT_COLOR, previousColor, 0);
gl.glColor3d(0, 1, 0);
for (TextureTile tile : tiles)
{
if (tile.getExtent(dc) instanceof Renderable)
((Renderable) tile.getExtent(dc)).render(dc);
}
Box c = Sector.computeBoundingBox(dc.getGlobe(), dc.getVerticalExaggeration(), this.levels.getSector());
gl.glColor3d(1, 1, 0);
c.render(dc);
gl.glColor4fv(previousColor, 0);
}
示例2: drawBoundingVolumes
import gov.nasa.worldwind.geom.Box; //导入依赖的package包/类
protected void drawBoundingVolumes(DrawContext dc, ArrayList<TextureTile> tiles)
{
GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.
float[] previousColor = new float[4];
gl.glGetFloatv(GL2.GL_CURRENT_COLOR, previousColor, 0);
gl.glColor3d(0, 1, 0);
for (TextureTile tile : tiles)
{
((Cylinder) tile.getExtent(dc)).render(dc);
}
Box c = Sector.computeBoundingBox(dc.getGlobe(), dc.getVerticalExaggeration(), this.levels.getSector());
gl.glColor3d(1, 1, 0);
c.render(dc);
gl.glColor4fv(previousColor, 0);
}
示例3: goTo
import gov.nasa.worldwind.geom.Box; //导入依赖的package包/类
/**
* Move to see a given sector.
*
* @param sector
* the sector to go to.
* @param animate
* if <code>true</code>, it animates to the position.
*/
public void goTo( Sector sector, boolean animate ) {
View view = getWwd().getView();
view.stopAnimations();
view.stopMovement();
if (sector == null) {
return;
}
// Create a bounding box for the specified sector in order to estimate
// its size in model coordinates.
Box extent = Sector.computeBoundingBox(getWwd().getModel().getGlobe(),
getWwd().getSceneController().getVerticalExaggeration(), sector);
// Estimate the distance between the center position and the eye
// position that is necessary to cause the sector to
// fill a viewport with the specified field of view. Note that we change
// the distance between the center and eye
// position here, and leave the field of view constant.
Angle fov = view.getFieldOfView();
double zoom = extent.getRadius() / fov.cosHalfAngle() / fov.tanHalfAngle();
// Configure OrbitView to look at the center of the sector from our
// estimated distance. This causes OrbitView to
// animate to the specified position over several seconds. To affect
// this change immediately use the following:
if (animate) {
view.goTo(new Position(sector.getCentroid(), 0d), zoom);
} else {
((OrbitView) wwd.getView()).setCenterPosition(new Position(sector.getCentroid(), 0d));
((OrbitView) wwd.getView()).setZoom(zoom);
}
}