![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jun 2009
Posts: 128
![]() |
Ok forgive me first off because I know there's several posts about this, however I'm still having issues with it.
First off. I'm drawing models with toolsheds model loader, and GlobeAnnotations I have point data being sent to me, LAT, LON and ALT (MEAN SEA LEVEL!). I have been creating Position variables just like this (wrongly) Code:
Position newPos = new Position(Angle.fromDegreesLatitude(Lat), Angle.fromDegreesLongitude(Lon), ALT); Code:
//ALT is MEAN SEA LEVEL double ELEV = (globe.getElevation(Angle.fromDegreesLatitude(Lat), Angle.fromDegreesLongitude(Lon))) + ALT; // Allocate and populate the new position Position newPos = new Position(Angle.fromDegreesLatitude(Lat), Angle.fromDegreesLongitude(Lon), ELEV); When I create the GlobeAnnotations I instatiate them by taking newPos (the position I created from my data) and instatiate them like this (a bit shorter version but concept is the same) Code:
Position GlobeAnnotationPosition = new Position( newPos.latitude, newPos.longitude, newPos.elevation); GlobeAnnotation GA = new GlobeAnnotation(); GA.setPosition(GlobeAnnotationPosition); All that basically to say... How do I properly instatiate a position variable when I'm receiving Altitude (mean sea level) and not the elevation?? And where am I going wrong? EDIT: Also, I'm drawing SphereAirspace objects. They appear in the same place as the Models, They are drawn significantly Lower than the GlobeAnnotations Last edited by Kashank; 06-03-2010 at 04:00 PM. |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Feb 2008
Location: Melbourne, FL, USA
Posts: 675
![]() |
I was under the impression that annotations are tied to the ground and use a drawOffset to adjust relative position.
so in my head model should be: PHP Code:
PHP Code:
|
|
|
|
|
|
#3 | |
|
Senior Member
Join Date: Jun 2009
Posts: 128
![]() |
Quote:
If you still don't know what I mean... Picture a comic book, where the leader(point) of the dialog bubble is inside the characters mouth... My model would be the characters mouth, and the dialog bubble is the globeannotation. Does your answer still apply? |
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Feb 2008
Location: Melbourne, FL, USA
Posts: 675
![]() |
GlobeAnnotations use Above Ground Level(AGL).
[assumption]Models use Mean Sea Level(MSL). so your position for annotation needs to be: PHP Code:
PHP Code:
EDIT: Heres another option Exert from getAnnotationDrawPoint javadoc Code:
* Get the final Vec4 point at which an annotation will be drawn. If the annotation Position elevation is lower then * the highest elevation on the globe, it will be drawn above the ground using its elevation as an offset, scaled by * the current vertical exaggeration. Otherwise, the original elevation will be used. from gov.nasa.worldwind.examples.Annotations. java PHP Code:
Last edited by heidtmare; 06-03-2010 at 05:53 PM. |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jun 2009
Posts: 128
![]() |
Thanks man! your first assumption was correct!
In one of my attempts I was close to getting it right, but I made one too many calculations with the AGL, as opposed to MSL. There's a great chance in the future that I will do your suggestion with overriding the class! I appreciate all your help |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Confusion about Position class | nigel25840 | Development Help | 4 | 04-05-2010 09:00 AM |
| WW1.3.2-Plugin: Layer Edit | canosso | Add-ons & Scripts | 21 | 02-27-2010 04:37 AM |
| Icons rendering relative to terrain elevation? | elevenette | Development Help | 13 | 11-10-2009 02:26 PM |
| New Elevation Data Layers | jdorny | Development Help | 1 | 06-12-2007 06:40 PM |
| Terrain elevation artifact | bchix | Technical Support | 1 | 03-06-2007 05:13 PM |