POV-Ray : Newsgroups : povray.general : why are differences soooo slow? : Re: why are differences soooo slow? Server Time
14 Nov 2024 21:13:02 EST (-0500)
  Re: why are differences soooo slow?  
From: Nieminen Mika
Date: 27 Apr 1999 13:41:04
Message: <3725e8a0.0@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
:   I have been worried about the coincedent surface problem. If you bound
: an object using an object that is too small it will end up clipping
: the object you are trying to bound. I simply over scale a bit to avoid
: this possibilty. All examples I have seen for bounding have always been
: scaled larger than the object to be bound and I practice by example.

  If I have understood correctly how bounding boxes work, then there's no
coincident surfaces problem with them. I'll try to explain:

union
{ object { Object1 }
  object { Object2 }
}

  Suppose that those two objects have a coincident surface. Now povray
will test ray-object intersections with those objects. When it's done, it
has to decide which one is nearer than the other. Since they are exactly
at the same place, the result is undefined.

  Now, suppose we have this:

object
{ Object1
  bounded_by { Object2 }
}

  You seem to think that this works like the union above.
  No. It works this way:
  First povray makes ray-object intersection tests with Object2. If the ray
doesn't hit Object2, then it forgets Object1.
  If the ray hits Object2, then it makes ray-object intersection tests with
Object1.
  The critical difference between these two things (union and bounding) is
that in the second case povray does _not_ calculate which object is nearer
(it doesn't need to). Since it doesn't have to calculate this, there's no
coincident surfaces problem. Povray calculates if a ray hits Object1 only
if it hits Object2.

  This has an interesting consequence: The bounding box doesn't need to be
surrounding the object it's bounding; it's enough that from the point of
view of the camera it completely covers the bounded object on screen.
  You can have your Object1 at 100000 units away from the camera and the
bounding Object2 at 0.01 units away from the camera (or viceversa). If the
Object2 completely covers Object1 on the screen, then the image will render
properly.
  Of course it's more easier to put bounding boxes aroung the objects they
are bounding. This way you can move the object and/or camera freely without
needing to change the position of the bounding object. But it's an
interesting detail which helps to understand how bounding boxes work.

  So why the bounding box should be as small as possible? The smaller the
bounding box is on screen, the less ray-object intersection tests povray
will make for Object1.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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