Lee Elliott writes: > > On Thursday 22 January 2004 22:54, Curtis L. Olson wrote: > > Lee Elliott wrote: > > > I've been giving quite a bit of thought to look-ahead algorithms for > > > terrain following. The most straight forward way would be to take a > > > number of look-ahead samples each frame, and simply take the highest > > > point as the target alt. > > I don't think you'd need to maintain the full 10 sec * 60fps buffer of samples > - just holding the sequence of high points should be ok, and you fly from > each one to the next. I don't think you really need to know about any lower > elevations within the look-ahead distance. > > You may not even need to maintain the full series of high-points either - it > might be possible to do it with just two or three high point values. > > Making sure you clear high ground is easy enough - just maintain a high value > and compare each new sample with it - if the new sample is higher then that > becomes the target and the new high value. Store the distance to the high > point each frame and then on the next frame re-calc it to see if it's closer > or further away - when the distance increases it's behind you.
I thnk the fastest way todo this will be to use the Graphics hardware. i.e. render only that part of the terrain that is within your lookahead distance with a *very* narrow field of view into a tall but skinny pbuffer with the eye point at the desired 'agl' distance beneath the current position with the view vector pointing in the direction of travel. Now you can read the position of the obstacles ahead directly from the pbuffer rendered into Cheers Norman _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel