Rectangle vs AABB intersection

Started by
0 comments, last by quasar3d 15 years, 1 month ago
Hi. I am working on a problem where I have a grid of AABB (in fact CUBES, all same size on all axis) and quads that can be on any orientation. Those quads are not necessarily quads, in fact are rectangles. Those rectangles are at most same size as of the size of the cube, never larger, but sometimes smaller. I have the option of divide the quad in 3 triangles then use the separation axis theorem. But I am hoping I can find a solution that is faster for this situation (since the quads with limited size constrains might help simplify the solution). I've been trying for a while. Tried working with the projection of the quad on each of the 3 axis aligned planes, but it didn't worked. I don need to know WHERE they intersect, only if they DO intersect. Now I come here for help. Has anyone seen any algorithm suited for this task? Thanks for any help you can offer.
Advertisement
You can use the separating axis theorem for rectangles too, where the axes you'll need to use are the two axes of the quad, the three axes of the box, and the cross products of all combinations of one axis from the rect, and one axis from the box.

This topic is closed to new replies.

Advertisement