![]() |
|
|||||||
| Add-on & Script Development Creating add-ons and scripts for World Wind. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jun 2005
Posts: 4
![]() |
I am writing an add-on to draw mesh objects on the terrain surface, but I'm having trouble getting the terrain elevation at a given lat,lon.
I'm trying: float elevation = (float)this._currentWorld.TerrainAccesso r.GetElevationAt(site.Latitude, site.Longitude); This does return a value but when I use it to render the objects they don't sit on the surface, and they are all roughly at the same height. If they're at a position of a mountain, they appear inside the mountain. I would be grateful for some help. Thanks, Adam. |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jun 2005
Location: France
Posts: 167
![]() |
Hi,
Funny, I aksed mashi the same question a few days ago ! Here's his answer on IRC chat : <IGE-Jean> mashi : how can i get the height (dem height) at a given point (lat, lon) ? <mashi> ok.. cool! <mashi> you are building a layer with terrain? <mashi> if so you can do QuadTileArgs.TerrainTileService.GetEleva tion... (something like that) <IGE-Jean> ho ho, not so much. I'm just trying to do another modification to your landmark plugin <IGE-Jean> Just to avoid having to set absolute altitude, replacing it with relative altitude (relative to the ground) <IGE-Jean> But i'd love to uild a layer with terrain <IGE-Jean> Until now, i just managed to do it tiling my data, and re-using the earth.xml and image.xml files <mashi> oh.. because then you don't have terrain readily available, you have to find a layer that has terrain (in the renderableobjects tree) or create a new TerrainTileService() <IGE-Jean> Oh. So, i believe i'm really lost.... (<IGE-Jean> Until now, i didn't really understand what we can access from the plugins, and how... <IGE-Jean> But maybe you could tell me ? ;o)) <mashi> fill in the blanks here: http://www.worldwindcentral.com/wiki/Plugin_FAQ ![]() <IGE-Jean> You mean, I fill the question, and YOU fill the answers ? ;o) <IGE-Jean> mashi : please, how to browse the renderableobjects tree ? I'd like to use the SRTM terrain. Looked for, but i'm really lost... <mashi> IGE-Jean: ParentApplication.WorldWindow.CurrentWor ld.ChildObjects I hadn't much time to work on it since he answered me, so I can't help you much further. But if you find the way, please, just tell me ? |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jun 2005
Posts: 4
![]() |
I have pretty much got it working but it's not completely accurate, if you can refine it to get it working better, please let me know...
float elevation = (float)this._masterLayer.WorldWindow.Cur rentWorld.TerrainAccessor.GetElevationAt (_latitude, _longitude, 100.0 / this._masterLayer.WorldWindow.DrawArgs.W orldCamera.ViewRange.Degrees) * World.Settings.VerticalExaggeration; |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Jan 2006
Posts: 4
![]() |
I noticed that if you try using GetElevationData(...) without specifying the third paramter, the wrong elevation can be returned. This could be where the accuracy problem is, although I am not sure what a better third parameter would be.
|
|
|
|
![]() |
| 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 |
| Terrain Elevation Data | Kevin Traver | Bug Reports | 1 | 02-01-2006 12:20 AM |
| Terrain Elevation for a Lat/Lon | beaker | Developers' Corner | 1 | 02-01-2006 12:05 AM |
| Catalog Aerial Imagery and Elevation | f0urtyfive | WorldWind General | 1 | 08-01-2005 03:31 AM |
| Terrain Mapping of DDS images | MetroGnome | Add-ons & Scripts | 3 | 03-17-2005 02:05 AM |
| Elevation slices | bkc | Suggestion Box | 1 | 09-30-2004 05:53 AM |