Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxc.cso.uiuc.edu!m.cs.uiuc.edu!shirley From: shirley@m.cs.uiuc.edu Newsgroups: comp.graphics Subject: Re: Answer to overlapping boxes Message-ID: <4400045@m.cs.uiuc.edu> Date: 11 Oct 89 16:40:15 GMT References: <4400044@m.cs.uiuc.edu> Lines: 13 Nf-ID: #R:m.cs.uiuc.edu:4400044:m.cs.uiuc.edu:4400045:000:387 Nf-From: m.cs.uiuc.edu!shirley Oct 10 10:58:00 1989 Another response made me realize this can be coded a little more concisely. If I have two boxes b1 and b2, the function can be: boolean intersect( b1, b2 ) { if ( (b1.max.x < b2.min.x) || (b1.min.x > b2.max.x) return FALSE; if ( (b1.max.y < b2.min.y) || (b1.min.y > b2.max.y) return FALSE; if ( (b1.max.z < b2.min.z) || (b1.min.z > b2.max.z) return FALSE; return TRUE; }