RE: [Algorithms] fast triangle-segment test *with precomputation*
Brought to you by:
vexxed72
From: <Chr...@Pl...> - 2000-08-05 06:24:47
|
Charles Bloom wrote: >Urgh; of course you're right; boxes that are outside but >near the corners are classified wrong. I think you could >probably detect that case and handle it from there; eg. >when the box straddles two edge planes, look at the vertex >those planes share, and then test whether the box is away >or towards the center of the triangle relative to that vertex >(or something). I kinda seems that way, doesn't it, but it's not quite that easy I'm afraid. Consider all the relative orientations that the triangle and the box can be in, and I think you'll find that what you'll end up with is going to be equivalent to doing all the required separating axis tests. Let's see... 3 for the edges/face normals of the box, 1 triangle face normal, 3 triangle edges, and 9 for combination of edges of both, so 16 axes. Christer Ericson SCEA, Santa Monica |