有没有办法在 WorldWind 中放置海拔高度的图像?我可以使用Surface Image在地球上放置图像——但我希望将它放在地形上方的给定高度,但我在 API 中找不到它。
问问题
319 次
1 回答
1
您可以将图像放在 a 上Polygon
并将其放置在您想要的任何高度。看看gov.nasa.worldwind.examples.Polygons
。相关线路是:
ArrayList<Position> pathLocations = new ArrayList<Position>();
pathLocations.add(Position.fromDegrees(28, -110, 5e4));
pathLocations.add(Position.fromDegrees(35, -108, 5e4));
pathLocations.add(Position.fromDegrees(35, -111, 5e4));
pathLocations.add(Position.fromDegrees(28, -111, 5e4));
pathLocations.add(Position.fromDegrees(28, -110, 5e4));
pgon = new Polygon(pathLocations);
pgon.setValue(AVKey.DISPLAY_NAME, "Has an image");
normalAttributes = new BasicShapeAttributes(normalAttributes);
normalAttributes.setDrawInterior(true);
normalAttributes.setInteriorMaterial(Material.WHITE);
normalAttributes.setInteriorOpacity(1);
pgon.setAttributes(normalAttributes);
pgon.setHighlightAttributes(highlightAttributes);
float[] texCoords = new float[] {0, 0, 1, 0, 1, 1, 0, 1, 0, 0};
pgon.setTextureImageSource("images/32x32-icon-nasa.png", texCoords, 5);
于 2016-03-22T21:29:11.030 回答