* BONNEVILLE David -- Monday 23 May 2005 10:52:
> I think Melchior will answer me the first [...]
Sorry, you didn't win the coffee machine! This was too easy to guess!
> How could I get the terrain elevation at a given lat/lon at runtime ?
> Could you point me to the right way ?
If I need elevation for the signs, I run fgfs solely for this purpose.
Here it's easy: Just set /position/longitude-deg and /position/latitude-deg
and wait until fgfs sets the appropriate /position/ground-elev-m for it.
It's not as much fun as it sounds, though:
- you don't really know when fgfs is done. Waiting too short causese
wrong values. Waiting too long causes gastric ulcer.
- you may not set the position to bucket boundaries, or fgfs won't set
the elevation at all
But if you say "at runtime", you possibly mean to get terrain elevation
while flying, so you can't simply teleport the aircraft to some lon/lat
just to read out a value. In this case you have to search for terrain
intersecion code in sg. I'm no expert in that. But Norman has already
pointed people there at several occasions, and you'll certainly find
something about it in the archives.
 http://members.aon.at/mfranz/flightgear/getelev [6 kB]
Flightgear-devel mailing list