NASAWorldWind / WorldWindJava

The NASA WorldWind Java SDK (WWJ) is for building cross-platform 3D geospatial desktop applications in Java.
724 stars 327 forks source link

Terrain Conforming not working on Track Airspace legs 3D #103

Open christopherpicard opened 7 years ago

christopherpicard commented 7 years ago

Worldwind Version: 2.1 Java Version 1.8.121

I am attempting to render a Track airspace that has no altitude range. For a polygon, the way we do this is set a very negative altitude and set terrainConforming on the shape to true. The result is a 2-dimensional like shape that hugs the ground.

When I try the same implementation for Track Airspace, nothing renderes. If I set the altitudes to 0, i do see a shattered looking shape. If the altitudes are in a positive range above the ground the 3D shape renders correctly.

I tried setting terrainConforming at both the TrackAirspace and leg levels, but neither seemed to have any affect.

No errors are generated when this issue occurs.

kotogadekiru commented 7 years ago

Hi. Did you tried disabling some layers? Can it be the case that you have some layer above ground level covering your polygon? Also you can try to access the elevationModel, getting the elevation for each position of your polygon and setting it to your altitude.

El 19 abr. 2017 22:53, "christopherpicard" notifications@github.com escribió:

Worldwind Version: 2.1 Java Version 1.8.121

I am attempting to render a Track airspace that has no altitude range. For a polygon, the way we do this is set a very negative altitude and set terrainConforming on the shape to true. The result is a 2-dimensional like shape that hugs the ground.

When I try the same implementation for Track Airspace, nothing renderes. If I set the altitudes to 0, i do see a shattered looking shape. If the altitudes are in a positive range above the ground the 3D shape renders correctly.

I tried setting terrainConforming at both the TrackAirspace and leg levels, but neither seemed to have any affect.

No errors are generated when this issue occurs.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NASAWorldWind/WorldWindJava/issues/103, or mute the thread https://github.com/notifications/unsubscribe-auth/AB_pYDzojZOy4dmS1WFcgZaUPYWSxFqhks5rxpCHgaJpZM4NCVq- .

christopherpicard commented 7 years ago

I did not try turning off additional layers, however all I have rendered on the map are the two overlays. One for the polygon with the negative altitudes that is working, and one for the Track that is not. Not sure how another layer would effect one object but no the other on the same layer.

The issue with accessing the altitude for the Track from the elevation model is you can only set at the points that define the center line, the box based on the width are calculated for you and would be really where you need to adjust the altitudes based on elevation. In order to do that I would have to render the Track as a series of polygons which is really the whole point of what the track is trying to provide.

basisbit commented 7 years ago

if you want to draw stuff directly on earth surface, maybe SurfacePolygon is what you want to use. For me the other polygon types are not really usable when drawing big country-spanning polygons with few edge points, because the lines between the points don't keep the relative hight above ground.

christopherpicard commented 7 years ago

We do use SurfacePolygons when we are in 2D mode, that shape however has different colors, settings and is controlled by our 2D parameters. To render a 2D shape in 3D mode only when the altitude range is small enough or not set to get interference from elevation is a possible workaround we are considering for now. Just a fair amount of work in our design.

just1victory commented 7 years ago

I think you can Use TrackAirspace.setDrawSurfaceShape(true) to force a SurfaceShape version of the TrackAirspace while using the 3D globe