POV-Ray : Newsgroups : povray.programming : bounding boxes problem and solution : Re: bounding boxes problem and solution Server Time
3 Jul 2024 06:09:36 EDT (-0400)
  Re: bounding boxes problem and solution  
From: Slime
Date: 2 Dec 2003 18:52:53
Message: <3fcd25d5@news.povray.org>
> Fine, but doing it in another step after parsing coan make it impossible
to
> effectively use bboxes during parsing (in trace(), in patches with
pigments
> delivering rendering of other parts of the scene).

The best way to handle this is probably to:

 - keep track of the object's transformation
 - during parsing, when the bounding box is called for (it can be made into
a function call or something for parsing-related functions), compute it from
the current transformation. Remember it in case it is needed again before
the object is transformed again, but once the object has been transformed,
throw away the current bounding box. (And set a flag that it needs to be
recomputed.) Note that the "base" bounding box will have to be stored
separately or recalculated each time the true bounding box is recalculated.
 - after parsing, calculate the final bounding box (from the base bounding
box with the final transformation).

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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