POV-Ray : Newsgroups : povray.general : megapov question : Re: megapov question Server Time
10 Aug 2024 09:13:47 EDT (-0400)
  Re: megapov question  
From: Mike Williams
Date: 31 Jan 2000 13:04:29
Message: <2hVKXEAKLal4Ew0m@econym.demon.co.uk>
Wasn't it hall who wrote:
>It seems to me the following two pieces of code should produce the same
>result (they don't).
>Can anyone tell me why? (I thought they should both be spheres, but code #1
>makes a really odd
>distorted shape)
>
>code #1:
>
>#declare x_val=function(x^2)
>#declare y_val=function(y^2)
>#declare z_val=function(z^2)
>#declare end_val=function(x_val+y_val+z_val)
>isosurface
>{
> function{end_val}  threshold .75  sign 1
> pigment {rgb 1}
>}

For some reason the max_gradient guesser has failed to produce the
correct result in this case, and the resulting surface does not
correspond to the mathematics of the function. To fix it you need to
tell it the correct max_gradient.

Step 1: add the "eval" keyword and render. This produces a rendering
that looks much more like the correct surface (but often has an
incorrect shadow), but it causes the correct value of max_gradient to
the log. In this case the actual max_gradient was 2.762

Step 2: Replace the "eval" keyword that you added in step 1 by
"max_gradient 2.762". This now produces a surface that is almost
identical to code #2.

You can use a higher value of max_gradient, which will also produce
correct results, but will take longer to render.

-- 
Mike Williams + #
Gentleman of Leisure


Post a reply to this message

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