5

我想用高程表示在地球上画一条线,如下所示:

立面表示草图

我知道我可以使用折线来表示一条线,但是如何填充线下方的空间?

4

2 回答 2

2

您可以使用路径来绘制线条。setOutlineMaterial 将绘制类似于您想要的“窗帘”。

Path path = new Path(pathPositions); //Arraylist of positions
final BasicShapeAttributes attrs = new BasicShapeAttributes();
attrs.setInteriorOpacity(0.25);
attrs.setInteriorMaterial(Material.BLACK);
attrs.setOutlineMaterial(new Material(color));
attrs.setOutlineWidth(width);
path.setAttributes(attrs);
path.setDrawVerticals(true);
path.setAltitudeMode(WorldWind.ABSOLUTE);

查看Path海拔模式,您希望它如何跟随地面。

于 2016-02-04T17:45:04.510 回答
1

您可以使用多边形,只需为其指定经纬度相同但海拔不同的点:

ArrayList<Position> pathPositions = new ArrayList<Position>();
pathPositions.add(Position.fromDegrees(28, -106, 3e4));
pathPositions.add(Position.fromDegrees(28, -106, 3e0));
pathPositions.add(Position.fromDegrees(35, -107, 9e0));
pathPositions.add(Position.fromDegrees(35, -107, 9e4));
pathPositions.add(Position.fromDegrees(28, -106, 3e4));
Polygon pgon = new Polygon(pathPositions);
于 2015-07-15T21:18:35.387 回答