Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 世界风的仰角图像_Java_Worldwind - Fatal编程技术网

Java 世界风的仰角图像

Java 世界风的仰角图像,java,worldwind,Java,Worldwind,有没有一种方法可以在海拔处的WorldWind中放置图像?我可以使用a将图像放置在地球上,但我希望将其放置在地形上方的给定高程,但我在API中找不到它。您可以将图像放置在多边形上,并将其放置在您想要的任何高程。看看gov.nasa.worldwind.examples.Polygons。相关线路为: ArrayList<Position> pathLocations = new ArrayList<Position>(); pathLocations.add(Positi

有没有一种方法可以在海拔处的WorldWind中放置图像?我可以使用a将图像放置在地球上,但我希望将其放置在地形上方的给定高程,但我在API中找不到它。

您可以将图像放置在
多边形上,并将其放置在您想要的任何高程。看看
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
,它会将图像拉伸到多边形的四个角。