World Wind Forums

Go Back   World Wind Forums > WorldWind Development (Other) > Add-on & Script Development

Add-on & Script Development Creating add-ons and scripts for World Wind.

Reply
 
Thread Tools Display Modes
Old 06-27-2005, 03:27 PM   #1
adamh128
Junior Member
 
Join Date: Jun 2005
Posts: 4
adamh128
Default

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.
adamh128 is offline   Reply With Quote
Old 06-29-2005, 03:56 PM   #2
jp09
Senior Member
 
Join Date: Jun 2005
Location: France
Posts: 167
jp09
Default

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 ?
jp09 is offline   Reply With Quote
Old 06-30-2005, 04:56 PM   #3
adamh128
Junior Member
 
Join Date: Jun 2005
Posts: 4
adamh128
Default

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;
adamh128 is offline   Reply With Quote
Old 02-01-2006, 11:58 PM   #4
Dave0
Junior Member
 
Join Date: Jan 2006
Posts: 4
Dave0
Default

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.
Dave0 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 06:46 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.