[ODE] Boxiangle collision

Nate W coding at natew.com
Fri May 10 01:53:01 2002


On Fri, 10 May 2002, Chris Campbell wrote:

> So in case 2 for the triangle in the flat heightmap which the sphere
> center is not directly above, the normal is not parallel. This non
> vertical normal causes the sphere to be pushed sideways a little. Not
> often and not by much but it is visibly annoying.

I see now.  I was confusing the contact normal and the surface (triangle)
normal.  I still think that if the sphere intersects two triangles, it
should be useful to compare the *triangle* normals (not contact normals,
my bad) for parallelism.  If parallel, use the one with deepest
penetration.  If the 'triangle normal rays' (rays extending from the
contact point along the triangle normal) point toward each other, it's the
valley situation (use both contacts), if they point away, it's the peak
situation (use either one).

> > Now suppose the ball lands on a "ridge," between two 
> > triangles.  Then what?  
> 
> This is no problem because the normals are exactly the same.

Good point.  I had the wrong normals in mind.

> > 6) With small triangles and large spheres, the sphere could 
> > conceivably intersect N triangles.  Then what?  Pick the nearest 2 or
> > 3?
>
> I don't know :)

Me neither, but I'll venture a guess anyhow, now that I've had several
entire seconds to think about it...  Suppose, if N > 3, you average all of
the vertices, and use the resulting point as the contact point, and figure
the normal from that point to the sphere center as usual.  My intuition
says that might work, especially if the triangles are all roughly the same
size.

-- 

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