POV-Ray : Newsgroups : povray.programming : sphere scaling bug : sphere scaling bug Server Time
29 Jul 2024 04:31:54 EDT (-0400)
  sphere scaling bug  
From: Nathan Kopp
Date: 19 Sep 1998 22:51:13
Message: <36045E84.18242E1E@ltu.edu>
Ok... there seems to be a bug in POV's sphere scaling code.  If you have a
sphere and you scale it uniformly, it will simply multiply the radius by your
scale factor instead of using a transformation matrix.  This is a speed
improvement under some circumstances, but it seems to lead to a bug when
the radius is veryu small.  Also, starting with a small radius leads to the
same problem.  the sphere gets smaller than it should.  Below is code that
shows two spheres lined up on the x axis.  The sphere on the right is
scaled by 0.005, while the sphere on the left is scaled by
<.005,.005,.00501> This forces the sphere on the right to use the
transformation instead of a very small radius, so it renders properly.

This is getting sent to Chris Young and to povray.programming.

-Nathan Kopp

---------------------------------------------------

// This scene was originally generated by Moray.

background { color <0.000,0.000,0.000> }

camera {  //  Camera StdCam
  location  <      0.000,     -25.000,       0.000>
  direction <        0.0,         0.0,   1097.8478> // Aperture is 0.07 degrees
  sky       <    0.00000,     0.00000,     1.00000> // Use right handed-system
(rotated by 0.00 degrees)!
  up        <        0.0,         0.0,         1.0> // Where Z is up
  right     <    1.33333,         0.0,         0.0> // Aspect ratio
  look_at   <      0.000,       0.000,       0.000>
}


light_source {   // Light1
  <0.000, -20.000, 20.000>
  color rgb <1.000, 1.000, 1.000>
}

#declare Texture1 = 
   texture { pigment {  color rgb <0.0, 1.0, 0.0>  } }

sphere { // Sphere001
  <0,0,0>,1
  texture { Texture1 }
  scale 0.005
  translate  0.005*x
}

sphere { // Sphere2
  <0,0,0>,1
  texture { Texture1 }
  scale <0.005, 0.005, 0.00501>
  translate  -0.005*x
}


Post a reply to this message

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