Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw a line with elevation representation in WorldWind

I want to draw a line on the globe with elevation representation, something like this :

Elevation representation sketch

I know I can use polyline to represent a line, but how can fill the space below the line ?

like image 761
Evans Belloeil Avatar asked Oct 20 '22 10:10

Evans Belloeil


2 Answers

You can use a path to draw the line. The setOutlineMaterial will draw a "curtain" similar to what you want.

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);

look at Path altitude mode how you want it follow the ground.

like image 64
Talon Avatar answered Nov 01 '22 08:11

Talon


You can use a polygon, just give it points with the same latitude and longitude but different elevations:

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);
like image 43
Chris K Avatar answered Nov 01 '22 10:11

Chris K