POV-Ray : Newsgroups : povray.programming : bounding boxes problem and solution : Re: bounding boxes problem and solution Server Time
3 Jul 2024 05:27:37 EDT (-0400)
  Re: bounding boxes problem and solution  
From: Andreas Kaiser
Date: 9 Dec 2003 06:23:00
Message: <3fd59943.1015270521@news.povray.org>
"Andrew Clinton" <ajc### [at] uwaterlooca> wrote:

>[...]

>The problem results from the fact that bounding boxes for csg objects are
>expanded independently for every transformation that is applied to the csg
>while parsing, without considering the effect on the underlying objects.
>
>[...]

This happens not only for csg objects but for almost any object.
Successive transformations lead to a degeneration of bounding boxes.
IMHO the solution is to use bounding planes during the parsing stage
(I've done this in my private version i'm working on for some years
now :).
The intersection of all bounding planes makes up the bounding volume
of an object.
When the scene has been parsed completely, the post-processing stage
is entered where the final axis aligned bounding box for each object
is calculated.

The benefits are:
- no degradation due to transformations
- cleaner code: you can remove most of the object specific
  recalculation when transforming an object. Any bounding plane can
  simply be transformed without any object specific handling.
- CSG Intersections can be bounded much more efficiently. For example
  imagine the intersection of several planes that make up some kind of
  Crystal (there's an example scene in the distribution). As these
  planes are not oriented towards the coordinate system's axis, each
  individual plane has an inifinite bounding box as has the resulting
  CSG.
  Using bounding planes instead you get an bounding box that fits the
  intersection object perfectly.

Intersection of CSG-Intersection object can be improved significantly
but i think i will present this for discussion in another post.

Andreas


Post a reply to this message

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