[ODE] Re: Heightfield / Collision.

Nate W coding at natew.com
Tue Feb 18 08:02:03 2003


On Tue, 18 Feb 2003, Amund [ISO-8859-1] Børsand wrote:

> > The actual heightfield is a 'sampling' at some resolution, that
> > represents a smooth, unfaceted terrain. Isn't it possible to test for
> > intersections against some form of interpolation function (e.g.
> > bilinear or bicubic), instead of triangles? 
> 
> My thoughts were that such a test would be extremely quick for any point
> in the map, which could be calculated instantaneously

Then the trick is finding the right X and Y coordinates for your
Z-and-normal lookup (assuming the height map builds on the XY plane, with
Z being "up").  If you have a sphere falling straight down toward a steep
section of terrain, how do you compute the X and Y for the contact point?  
You can't look straight down from the sphere's center, because steep
terrain is going to contact the sphere from the side.  Is there a fast way
to get the answer?  

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com