Anyone have an algorithm (pseudo code or in C) that detects when two bounding boxes overlap? I’m writing code to detect neighbouring polygons by traversing line segments of the polygons and looking for collinearity. I’ve got collinearity of lines detected, but now I need to restrict my focus to adjacent segments. I was told that I could detect overlap of bounding boxes to do this, but I can’t think of how to do this (without hacking some really ugly code). Any help?
If for bounding box you mean
of two objects and the reference system is THE SAME for both it
if NOT ((Xmax1 < Xmin2 OR Xmax2 < Xmin1) AND
(Ymax1 < Ymin2 OR Ymax2 < Ymin1) AND
(Zmax1 < Zmin2 OR Zmax2 < Zmin1)
then the intersects
P.S. Why oh, why there is a Q&A forum?
Thanks, I have figured it out. With regards to your post script, in this particular forum I can “chat about anything related to Computer Graphics or elYsiun”. Since a question certainly falls under the category of “chatting”, this question is not the least bit off topic. It would have been had I gone to the questions forum which is a “place to ask Questions about Blender”.
I will spare you a smart-ass post script
you are right, this is about “computer graphics”