POV-Ray : Newsgroups : povray.binaries.images : why the difference??? : Re: why the difference??? Server Time
19 Aug 2024 20:18:28 EDT (-0400)
  Re: why the difference???  
From: Mike Williams
Date: 21 Oct 2000 02:06:25
Message: <GhZalLASIT85EwOS@econym.demon.co.uk>
Wasn't it Oded who wrote:
>between the following two pov-codes' results.
>I have no idea, hope someone can tell me why two identical objects look
>different
>one is a simple CSG, the other an isosurface
>attached are the results...

I don't fully understand why the two objects look different, but I can
tell you that it's the isosurface that's wrong, and I can tell you what
you can do to fix it.

But you may not like the solution.



Method 1 isosurfaces sometimes have problems when the function has an
extremely high gradient, so you can fix it by using method 2, i.e. be
adding either

   method 2
   eval

or, in this particular case,

   method 2
   max_gradient 4000

The reason that you may not like the solution is that it now takes a
ridiculously long time to render the image.

Note that, for this function, the max_gradient is dependent on the
accuracy. The gradient is really infinite at the surface of the object
because the value of "if(1 - x,0,1)" changes from 0 to 1 over an
arbitrarily small distance. The smallest distance that gets considered
depends on the accuracy setting.


An alternative solution would be to generate the isosurface box from a
function that has less steep gradients, such as 

isosurface {
        function { (y*y-0.5) & (x*x-0.5) & (z*z-0.5) }
        threshold 0.5
        contained_by {box <-2,-2,-2><2,2,2>}
        pigment {rgb 1}
}

Which is correct whether you use method 1 or method 2, and renders
quickly if you use method 1 or if you make the bounding box a reasonable
size.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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