Re: [Flightgear-devel] Terrain elevation question
On Monday 24 January 2005 23:56, David Luff wrote: > On 24/01/2005 at 21:17 Durk Talsma wrote: > >What I am really looking for is a hint where I can find the code in > >FlightGear > > Hi Durk, > > I obtain ground elevation for taxiing AI traffic in AILocalTraffic.cxx, > lines 1569 - 1602 (or thereabouts). Note that this is not a cheap > operation, and you should only do it for traffic in a location which > already has a tile loaded - otherwise it triggers tile loading, resets the > scenery cache to the wrong location, and probably has other undesirable > side effects as well. > Hi Dave, Thanks, That's exactly what I was looking for. Cheers, Durk ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Terrain elevation question
On 24/01/2005 at 21:17 Durk Talsma wrote: > >What I am really looking for is a hint where I can find the code in >FlightGear Hi Durk, I obtain ground elevation for taxiing AI traffic in AILocalTraffic.cxx, lines 1569 - 1602 (or thereabouts). Note that this is not a cheap operation, and you should only do it for traffic in a location which already has a tile loaded - otherwise it triggers tile loading, resets the scenery cache to the wrong location, and probably has other undesirable side effects as well. I'm still not entirely sure how all this works, but when I dug into it once it seems that the way I do it can mess with the tile cache unless I'm not determining elevation for the tile currently at the center of the cache (or something like that). FG could really do with a clear, unambiguous, documentated elevation API of the GetGroundElevation(lat, lon) type that would not mess with the tile cache, and not bother giving accurate elevations for unloaded tiles. Until then, a lot of subsystem writers have / will spend a significant amount of time figuring out how to get a ground elev, and wondering what they're breaking whilst doing it. As Curt says, regardless of the above, ground elev will always be expensive - if the airport has a node arc layout you could dynamically cache lookups for following traffic, interpolate between reasonable differences, etc, etc. Cheers - Dave This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
RE: [Flightgear-devel] Terrain elevation question
Durk Talsma writes: > > What I am really looking for is a hint where I can find the code in > FlightGear > that actually does these calculations. I tried tracing back through the > functions that eventually set the value of > the /environment/ground-elevation-m property, but couldn't really figure it > out. Durk The code lives in $FGFS / scenery / tilemanager.XXX hitlist.XXX HTH Norman ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
RE: [Flightgear-devel] Terrain elevation question
Curtis L. Olson writes: > > The terrain elevation system could stand to be looked at a bit. I think > there is still a lurking bug where the wrong elevation can be returned > under some circumstances immediately after a tile boundary is crossed. > There are some optimizations in the current system that assume you are > reading ground elevation from the same tile or same position stream as > before. My guess is one wants to look closely at the 'in airport', 'on airport border' and 'airport crosses tile boundary' cases. Norman ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Terrain elevation question
On Monday 24 January 2005 20:57, Curtis L. Olson wrote: > Hi Durk, > > The terrain elevation system could stand to be looked at a bit. I think > there is still a lurking bug where the wrong elevation can be returned > under some circumstances immediately after a tile boundary is crossed. > There are some optimizations in the current system that assume you are > reading ground elevation from the same tile or same position stream as > before. > > Be aware that looking up terrain elevation from a TIN is an expensive > operation so we don't want to do very many of these lookups per frame. > Perhaps your AI system could do one lookup per frame and rotate through > the model list so the entire list is updated ever "n" frames ... or > prioritize models that are on/near the ground over models that are high > above the ground where it really doesn't matter so much. > > Does that answer your question? > Curt, What I am really looking for is a hint where I can find the code in FlightGear that actually does these calculations. I tried tracing back through the functions that eventually set the value of the /environment/ground-elevation-m property, but couldn't really figure it out. Thanks for your explanation of the costs and pitfalls, I'll certainly take it into account. For a start, I would only do this for models that are on -or near- the ground, and use the general airport elevation for any other situation. Secondly, it would only be required to do this for traffic that is within a reasonable distance of the user. Thanks, Durk ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Terrain elevation question
Durk Talsma wrote: Hi Folks, Since I haven't seen any response to my question I guess it's either so hard that nobody knows the answer, or it just slipped by while everybody was fighting each other last week. :-) Anyways, I'm still interested in potential solutions. Cheers, Durk On Saturday 22 January 2005 18:01, Durk Talsma wrote: Hi, I would like to experiment a little bit with adding current terrain elevation detection for AI models. Is there a function to do this, i.e. double fgGetElevation(double lat, double lon); I found that the current user location is read from /environment/ground-elevation-m but that's the elevation at the user location and not at the position of the AI plane. The reason I'm looking into this is that even at EHAM, which is quite flat there are already some very visible artifacts due to variations in ground elevation. So we'd need to address this sooner or later. Hi Durk, The terrain elevation system could stand to be looked at a bit. I think there is still a lurking bug where the wrong elevation can be returned under some circumstances immediately after a tile boundary is crossed. There are some optimizations in the current system that assume you are reading ground elevation from the same tile or same position stream as before. Be aware that looking up terrain elevation from a TIN is an expensive operation so we don't want to do very many of these lookups per frame. Perhaps your AI system could do one lookup per frame and rotate through the model list so the entire list is updated ever "n" frames ... or prioritize models that are on/near the ground over models that are high above the ground where it really doesn't matter so much. Does that answer your question? Curt. -- Curtis Olsonhttp://www.flightgear.org/~curt HumanFIRST Program http://www.humanfirst.umn.edu/ FlightGear Project http://www.flightgear.org Unique text:2f585eeea02e2c79d7b1d8c4963bae2d ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Terrain elevation question
Hi Folks, Since I haven't seen any response to my question I guess it's either so hard that nobody knows the answer, or it just slipped by while everybody was fighting each other last week. :-) Anyways, I'm still interested in potential solutions. Cheers, Durk On Saturday 22 January 2005 18:01, Durk Talsma wrote: > Hi, > > I would like to experiment a little bit with adding current terrain > elevation detection for AI models. Is there a function to do this, i.e. > > double fgGetElevation(double lat, double lon); > > I found that the current user location is read > from /environment/ground-elevation-m but that's the elevation at the user > location and not at the position of the AI plane. > > The reason I'm looking into this is that even at EHAM, which is quite flat > there are already some very visible artifacts due to variations in ground > elevation. So we'd need to address this sooner or later. > > Cheers, > Durk > > > ___ > Flightgear-devel mailing list > Flightgear-devel@flightgear.org > http://mail.flightgear.org/mailman/listinfo/flightgear-devel > 2f585eeea02e2c79d7b1d8c4963bae2d ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d