Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!uunet!seismo!dimacs.rutgers.edu!aramis.rutgers.edu!paul.rutgers.edu!njin!uupsi!eye!erich From: erich@eye.com (Eric Haines) Newsgroups: comp.graphics Subject: Re: intersecting planes and spheres Summary: forget my idiotic reply... Message-ID: <1991May29.145720.3440@eye.com> Date: 29 May 91 14:57:20 GMT References: <1991May23.205708.9746@hellgate.utah.edu> Sender: Eric Haines Reply-To: erich@eye.com (Eric Haines) Organization: 3D/Eye Inc., Ithaca, NY Lines: 22 In article glassner@parc.xerox.com (Andrew Glassner) writes: >A previous poster writes: >>Actually, I need to know whether a sphere intersects a cube, and >>if so which side of the cube. > >A solution is presented in "A Simple Method for Box-Sphere >Intersection Testing," by Jim Arvo, in the book "Graphics Gems," >published by Academic Press (pp. 335-339). Wow! Withdraw, delete, cancel my incredibly long-winded, lousy answer to this question - Andrew's absolutely correct, Jim's method is elegant and faster than fast. Amazing what a shift in perspective can do! Summary: check X,Y, and Z coordinates separately; if the sphere's center for an axis is inside the box, ignore it, otherwise sum the distance squared from the closer box end. If this sum is less than or equal to the sphere's radius squared, the sphere intersects the box! Whack me with a Zen Master's stick! Mu! Much enlightened, Eric