Java 世界风的仰角图像
有没有一种方法可以在海拔处的WorldWind中放置图像?我可以使用a将图像放置在地球上,但我希望将其放置在地形上方的给定高程,但我在API中找不到它。您可以将图像放置在Java 世界风的仰角图像,java,worldwind,Java,Worldwind,有没有一种方法可以在海拔处的WorldWind中放置图像?我可以使用a将图像放置在地球上,但我希望将其放置在地形上方的给定高程,但我在API中找不到它。您可以将图像放置在多边形上,并将其放置在您想要的任何高程。看看gov.nasa.worldwind.examples.Polygons。相关线路为: ArrayList<Position> pathLocations = new ArrayList<Position>(); pathLocations.add(Positi
多边形上,并将其放置在您想要的任何高程。看看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);
ArrayList路径位置=新建ArrayList();
添加(Position.fromDegrees(28,-110,5e4));
添加(Position.fromDegrees(35,-108,5e4));
添加(Position.fromDegrees(35,-111,5e4));
添加(Position.fromDegrees(28,-111,5e4));
添加(Position.fromDegrees(28,-110,5e4));
pgon=新多边形(路径位置);
pgon.setValue(AVKey.DISPLAY_NAME,“有图像”);
normalAttributes=新的基本形状属性(normalAttributes);
normalAttributes.setDrawInterior(true);
normalAttributes.setInteriorMaterial(Material.WHITE);
normalAttributes.setInteriorOpacity(1);
pgon.setAttributes(normalAttributes);
pgon.setHighlightAttributes(highlightAttributes);
float[]texCoords=新的float[]{0,0,1,0,1,1,0,0};
pgon.setTextureImageSource(“images/32x32 icon nasa.png”,texCoords,5);
这会像扇区用于SurfaceImage一样将图像拉伸到多边形的大小吗?如果使用上例中的texCoords
,它会将图像拉伸到多边形的四个角。