[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: linuxgames@sunsite.dk*Subject*: Re: Intersection of two cylinders*From*: Steve Baker <sjbaker1@airmail.net>*Date*: Thu, 21 Mar 2002 04:42:33 -0600*Delivered-To*: archiver@seul.org*Delivered-To*: mailing list linuxgames@sunsite.dk*Delivery-Date*: Fri, 15 Mar 2002 09:37:29 -0500*Mailing-List*: contact linuxgames-help@sunsite.dk; run by ezmlm*Organization*: Steve at Home*References*: <1.5.4.32.20020315132822.009bc560@mail.glinx.com> <3C91F927.4040703@starforge.co.uk>*Reply-To*: linuxgames@sunsite.dk*Sender*: steve@seul.org

Chris wrote: > > Henningsen wrote: > > > If you've made a solid search, I would assume that there simply is no simple > > formula. The volume is given by a double integral, and if it cannot be > > solved by a formula you will have to numerically approximate that integral, > > which will require substantial computation irrespective of what type of > > numerical integration method you choose. > > <snip good advise> > > Thanks Peter, now I've got to make up my mind whether I can affort to do > a fair bit of work (it only needs to be done once in several thousand > frames) or whether I can come up with a better method for the whole thing. I guess that for infinitely long cylinders, this is a function of two variables - the distance of closest approach of the two centerlines and the angle between them (as projected into the plane that's perpendicular to that line of shortest distance). Since both variables are nicely bounded (the angle is 0..90 degrees and the distance is 0..sum-of-radii), you could compute a lookup table offline using all that nasty math that you already found - and interpolate between table entries or something. That ought to produce pretty good results even with a fairly small table because this is a nice, smooth function. Of course, if you have lots of cylinders of varying radii, then you'll need to add a third variable - the ratio of the two radii - and scale the results from the table according to the actual radii. I guess that it all comes down to how much precision you need and how much memory you are prepared to burn on the lookup table. > Why can't we have an easy to calulcate universe! :)) I guess that in parallel universes where math is easy, there are also fundamental laws of nature that prevent CPU's from running faster than 1MHz. :-) ----------------------------- Steve Baker ------------------------------- Mail : <sjbaker1@airmail.net> WorkMail: <sjbaker@link.com> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net

**Follow-Ups**:**Re: Intersection of two cylinders***From:*Chris <chris@starforge.co.uk>

**References**:**Re: Intersection of two cylinders***From:*Henningsen <alg@glinx.com>

**Re: Intersection of two cylinders***From:*Chris <chris@starforge.co.uk>

- Prev by Date:
**Re: Intersection of two cylinders** - Next by Date:
**Re: Intersection of two cylinders** - Prev by thread:
**Re: Intersection of two cylinders** - Next by thread:
**Re: Intersection of two cylinders** - Index(es):