POV-Ray : Newsgroups : moray.win : Bounding box? Server Time
29 Jul 2024 06:25:22 EDT (-0400)
  Bounding box? (Message 1 to 5 of 5)  
From: Alex Magidow
Subject: Bounding box?
Date: 11 Mar 1999 18:12:54
Message: <36E84DC0.49062F9E@mninter.net>
What is a bounding box, what is it for, and will it speed up media?
--
Only I can prevent narcissism!


Post a reply to this message

From: Kyle
Subject: Re: Bounding box?
Date: 11 Mar 1999 21:46:33
Message: <36E87FE0.5E4C3D55@geocities.com>
I've been wondering the same thing.  This is my interpretation.... If
you put a bounding box around an object, when POV-Ray parses the scene,
it uses the boxes to determine if the enclosed object is visible in the
scene. If not, it will not include the object, thus reducing memory
consumption.  Like i said, I really don't know for sure so I wouldn't
trust a word of what I wrote above.  I'm curious to know what it is
exactly.
		Kyle


Alex Magidow wrote:
> 
> What is a bounding box, what is it for, and will it speed up media?
> --
> Only I can prevent narcissism!


Post a reply to this message

From: Ken
Subject: Re: Bounding box?
Date: 11 Mar 1999 22:36:10
Message: <36E88AE9.B9A07A1D@pacbell.net>
Kyle wrote:
> 
> I've been wondering the same thing.  This is my interpretation.... If
> you put a bounding box around an object, when POV-Ray parses the scene,
> it uses the boxes to determine if the enclosed object is visible in the
> scene. If not, it will not include the object, thus reducing memory
> consumption.  Like i said, I really don't know for sure so I wouldn't
> trust a word of what I wrote above.  I'm curious to know what it is
> exactly.
>                 Kyle

  That is not quite correct. Think of it this way. A box has 6 faces and
12 edges. When pov shoots rays in to the scene to see what they rays strike
it will have to account for the bouncing of the rays from the different
faces and edges that the rays encounter. When you have multiple objects
used in a csg operation, the objects, even though some of the edges are
missing from being in a csg, are still intact from the point of view of
the ray calculation process. What the bounding box does is confine the
shape of the object as a single entity instead of a group of objects
joined together. This speeds up rendering because it doesn't have to
calculate all of the interior edges that have been removed by the csg
operation. In other words it's no longer a group of primitives it is a
new primitive with a unique shape.

  As to whether this may be allowed with media and if it would make a
difference is something of a different matter. I just did a simple test
using one of the example files that comes with Pov and it took 2 sec.
longer with a bounding object. It appears that the benefits are 0.
The extra two second were probably the added time it took to issue the
warning that the sphere I bounded was unnecessarily bounded.
-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Kyle
Subject: Re: Bounding box?
Date: 11 Mar 1999 22:51:10
Message: <36E88EFF.A8DF8187@geocities.com>
"Sampsonite! I was way off."

Now I get it.  Thanks alot for the explanation Ken.
		
		Kyle

Ken wrote:
> 
> Kyle wrote:
> >
> > I've been wondering the same thing.  This is my interpretation.... If
> > you put a bounding box around an object, when POV-Ray parses the scene,
> > it uses the boxes to determine if the enclosed object is visible in the
> > scene. If not, it will not include the object, thus reducing memory
> > consumption.  Like i said, I really don't know for sure so I wouldn't
> > trust a word of what I wrote above.  I'm curious to know what it is
> > exactly.
> >                 Kyle
> 
>   That is not quite correct. Think of it this way. A box has 6 faces and
> 12 edges. When pov shoots rays in to the scene to see what they rays strike
> it will have to account for the bouncing of the rays from the different
> faces and edges that the rays encounter. When you have multiple objects
> used in a csg operation, the objects, even though some of the edges are
> missing from being in a csg, are still intact from the point of view of
> the ray calculation process. What the bounding box does is confine the
> shape of the object as a single entity instead of a group of objects
> joined together. This speeds up rendering because it doesn't have to
> calculate all of the interior edges that have been removed by the csg
> operation. In other words it's no longer a group of primitives it is a
> new primitive with a unique shape.
> 
>   As to whether this may be allowed with media and if it would make a
> difference is something of a different matter. I just did a simple test
> using one of the example files that comes with Pov and it took 2 sec.
> longer with a bounding object. It appears that the benefits are 0.
> The extra two second were probably the added time it took to issue the
> warning that the sphere I bounded was unnecessarily bounded.
> --
> Ken Tyler
> 
> mailto://tylereng@pacbell.net


Post a reply to this message

From: Rudy Velthuis
Subject: Re: Bounding box?
Date: 12 Mar 1999 07:08:13
Message: <36e903ad.0@news.povray.org>
Ken schrieb in Nachricht <36E88AE9.B9A07A1D@pacbell.net>...

>  That is not quite correct. Think of it this way. A box has 6 faces and
>12 edges. When pov shoots rays in to the scene to see what they rays strike
>it will have to account for the bouncing of the rays from the different
>faces and edges that the rays encounter. When you have multiple objects
>used in a csg operation, the objects, even though some of the edges are
>missing from being in a csg, are still intact from the point of view of
>the ray calculation process. What the bounding box does is confine the
>shape of the object as a single entity instead of a group of objects
>joined together. This speeds up rendering because it doesn't have to
>calculate all of the interior edges that have been removed by the csg
>operation. In other words it's no longer a group of primitives it is a
>new primitive with a unique shape.
>
>  As to whether this may be allowed with media and if it would make a
>difference is something of a different matter. I just did a simple test
>using one of the example files that comes with Pov and it took 2 sec.
>longer with a bounding object. It appears that the benefits are 0.
>The extra two second were probably the added time it took to issue the
>warning that the sphere I bounded was unnecessarily bounded.


The way I understand it (and would implement it myself), bounding boxes are
used by POV-Ray to determine if a ray could hit a complex object at all. If
the bounding box is not hit, the object can be disregarded by this
particular ray. So bounding boxes divide the scene into a few simpler
sub-scenes. If the bounding box is hit, you must still do a hit test for the
real object(s) in the box. That's why your sphere took longer, and even a
complex CSG will take a bit longer. But the scene outside the bounding box
will (propably) be faster. So the overall render time *could* be shorter,
and for complex scenes propably will be.

To clarify: If there are two complex CSGs, both made out of some 30 objects,
then the ray will first test the two bounding boxes. If it hits one of the
CSG, it will test all objects in this CSG, but not the objects in the other
CSG, and vice versa. If there were no bounding boxes, the ray would always
have to test all 60 objects in the scene.

Boxes are, as you mentioned, not the best kind of objects to test
intersections on, unless they are all orthogonal and not rotated - so the
vertices all ly on one of the axes. Then just a simple test on the
coordinates could already be a simple hit test. So I assume bounding boxes
are like that.

--
Rudy Velthuis


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.