I’ve been reading a whole lot on the “Separating Axis Test” and from all the posts and articles I get the idea that they are all for 2D collisions, and not 3D. I heard that it’s more of a “Separating plane Theorem” for 3D space, but where to find information about how this method differs from the 2D version is unclear to me.
Should I be using the SAT, because I’m trying to compute whether the triangle has intersected the Axis-Aligned Bounding Box (AABB). I don’t need to know where the intersection occured, just a boolean result if it did or did not occur.
My main attempt at implementing the SAT is located here: Implementation attempt.
If the SAT needs to be modified, then what needs to be changed for it to be succesfully implemented in 3D space? Since at the moment there are 13 axes to be tested according to Christer Ericson from his book Real-Time Collision Detection. If the SAT needs to be changed then I would think that there would be more axes to test, since there is a third axis involved.
- Three face normals from the AABB
- One face normal from the triangle
- Nine axes given by the cross products of combination of edges from both
I need to understand if the SAT needs to be modified, and a push in the direction of where to modify and why. If no modification is needed, where am I going wrong? Thanks!
After reading many different posts, articles, and papers (of which the best resource was this article) I now know that no modification needs to be made to the SAT for 3D collision detection.
Although I’m still having some problems with my implementation, I can say that for the AABB (cube), you have to test 3 surface normals, corresponding to the x, y, and z axis. For the triangle, it looks like there needs to be 4 normals, one for each edge and one for the surface (I am not completely sure on the triangle normals since I still have to test. I tried with one normal and had 80% working).
For the AABB (cube), the normals are calculated by getting two perpendicular edges of a surface and getting the cross-product of those two edges.
The triangle surface normal is calculated in the same way.
After that the SAT takes the projections of the AABB and the triangle and tests those on the AABB axes (normals) then this is repeated on the triangle axes (normals) and if any one of the tests detects a gap there is no collision.