## RE: [Algorithms] Bounding cones.

 RE: [Algorithms] Bounding cones. From: Tom Forsyth - 2004-01-29 05:45:05 ```Yeah, a bounding box aligned to, say, the world axis isn't nearly good enough. Think of two very small objects at (1,1,1) and (10,10,10) relative to the light. The bounding cone is pretty slim. But the bounding box is 9 units on a side, which is enormous! And yes, this is a moderately common case :-) TomF. > -----Original Message----- > From: gdalgorithms-list-admin@... > [mailto:gdalgorithms-list-admin@...] On > Behalf Of Greg Seegert > Sent: 28 January 2004 20:41 > To: gdalgorithms-list@... > Subject: RE: [Algorithms] Bounding cones. > > > I know you asked for an algorithm to merge cones, but for > what you're trying > to do, do you have access to any other information besides > the cone for each > object? I imagine it would be pretty easy to merge the > bounding boxes of > your objects, and form a cone from the light to the center of > the bbox, with > a theta of arcsin(bounding_radius/distance)? I'm sure I'm > missing something > here though - maybe this isn't tight enough of a fit. > > -----Original Message----- > From: gdalgorithms-list-admin@... > [mailto:gdalgorithms-list-admin@...]On Behalf Of Tom > Forsyth > Sent: Tuesday, January 27, 2004 2:38 PM > To: gdalgorithms-list@... > Subject: [Algorithms] Bounding cones. > > > I have a bunch of circular-cross-section cones in 3D space, > all originating > from a single point (assume it's the origin). They are defined by a > unit-length vector V (the central axis) and a cos(theta) > term, where theta > is half the base angle. All points P on the cone obey the equation > (P.V)/|P|=cos(theta). I've worked out the maths to take two > cones and find > the cone that tightly bounds both of them. So I can merge a > bunch of cones > by calling this on pairs of cones, but depending on the order > you combine > them you get a very loose-fitting result, and the more cones > you want to > merge, the looser the result fits. > > So I'm wondering if anyone knows a good way to find the > bounding cone of a > whole bunch of cones. If the cone angle goes over 180 then > it's fine to > return "don't know", so it doesn't need to handle crazy cases. > > I'm using this to find frustums for shadowbuffers - each object is > represented by a cone from the (point)light that bounds the > mesh, and I want > to find the frustum that bounds a collection of objects as tightly as > possible. > > I have a feeling this is a similar problem to finding good > bounding spheres, > but I don't know how to solve that particularly well either. It's also > almost identical to the 2D version - finding bounding circles > - but not > quite because the circles are the projections of the cones on > the surface of > the unit sphere - you can't simply project them to a flat > plane and solve > the problem there because (a) which plane do you use? and (b) > they're not > circles when you project them, they're ellipses. > > TomF. > > > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_ida88 > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > ```