alecjacobson/computer-graphics-bounding-volume-hierarchy

triangle-trianlge box-box intersections

Closed this issue · 5 comments

Just wondering if one vertex of triangle touches the other triangle, does it count as a hit? what about for boxes?

I'd say that these (literal) corner cases count as hits, but the chances of this happening between two arbitrary meshes (or two bounding boxes of arbitrary sets of objects) are quite low.

I had errors when running the following
./intersections ../data/fandisk.obj ../data/fandisk.obj
i.e. to intersect the same objects.

And I get a lot of errors if those corner cases count for triangles.
and I got only 6 errors when the corner cases don't count for triangles.

I got all other combinations error-free except the above one. And I am kind of stuck on that. Do we need to consider intersecting the same objects?

The brute force intersection code (in intersections.cpp) uses the triangle-triangle intersection routine that you use in your AABB intersections, so they should recognize the same intersections if they compare the same relevant triangles. Also, adding additional box-box intersections shouldn't affect correctness, since they only create extra candidate pairs during the broad phase. I would say that the bug is likely in your find_all_intersecting_pairs_using_AABBTrees, not your intersection routines.

I should also mention that the bug is not necessarily in any of your intersection code directly, but it could also be in code that it depends on from previous parts of the assignment.

Thanks, I will try my best to find it........