POV-Ray : Newsgroups : povray.beta-test : sphere sweep bounding problem : sphere sweep bounding problem Server Time
29 Jul 2024 14:25:27 EDT (-0400)
  sphere sweep bounding problem  
From: David Necas (Yeti)
Date: 27 Apr 2002 08:12:08
Message: <slrnacl5co.so7.yeti@monoceros.physics.muni.cz>
The sphere_sweep autobounding either works pretty poorly or not at
all.

Consider following example (a single, very small object - either a
sphere_sweep or a cone - in the center of the image) and render it
with -UR (so user boundings are not removed), and with preview, if
possible.  You'll notice the empty grey background renders pretty
slow.  By uncommenting the USE_BOUNDING line to add an explicit
bounding or by uncommenting the USE_CONE line to replace the
sphere_sweep with some object with working autobounding you make the
render about 6x faster -- namely the background.  This probably means
the sphere_sweep autobounding is broken (the object itself is so small
so that its own rendering time doesn't matter much).

  //#declare USE_CONE = 1;
  //#declare USE_BOUNDING = 1;

  light_source { <-2, 5, -2> rgb 1 }
  camera { location <-50, 0, 0> look_at <0, 0, 0> }
  background { color rgb 0.4 }

  #declare P1 = <0,-2,0>;
  #declare P2 = <0,2,0>;
  #declare R1 = 1;
  #declare R2 = 0.1;

  #ifdef (USE_CONE)
    cone {
      P1, R1, P2, R2
  #else
    sphere_sweep {
      cubic_spline
      5
      P1 R1
      (0.7*P1 + 0.3*P2) (0.7*R1 + 0.3*R2)
      (0.5*P1 + 0.5*P2) (0.5*R1 + 0.5*R2)
      (0.3*P1 + 0.7*P2) (0.3*R1 + 0.7*R2)
      P2 R2
  #end
    pigment { colour rgb <0,1,0> }
    #ifdef (USE_BOUNDING)
      bounded_by { box { <-2,-3,-2>, <2,3,2> } }
    #end
  }


Yeti


Post a reply to this message

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