POV-Ray : Newsgroups : povray.general : megapov question Server Time
10 Aug 2024 09:17:09 EDT (-0400)
  megapov question (Message 1 to 4 of 4)  
From: hall
Subject: megapov question
Date: 30 Jan 2000 10:52:18
Message: <38945e32@news.povray.org>
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}
}

and

code #2:
#declare end_val=function(x^2+y^2+z^2)
isosurface
{
 function{end_val}  threshold .75  sign 1
 pigment {rgb 1}
}

thanks,

Quadhall
tre### [at] ww-interlinknet


Post a reply to this message

From: David Fontaine
Subject: Re: megapov question
Date: 30 Jan 2000 17:06:25
Message: <3894B5B7.7444AAB5@faricy.net>
I don't know if this is it, but I thought when using a declared function in
megaPOV you were supposed to include (x,y,z) after it.

--
Homepage: http://www.faricy.net/~davidf/
___     ______________________________
 | \     |_       <dav### [at] faricynet>
 |_/avid |ontaine      <ICQ 55354965>


Post a reply to this message

From: Mike Williams
Subject: Re: megapov question
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

From: hall
Subject: Re: megapov question
Date: 31 Jan 2000 21:13:43
Message: <38964157@news.povray.org>
Mike Williams wrote ........

Thanks for the info, will see what I can do with it.....

Quadhall
tre### [at] ww-interlinknet


Post a reply to this message

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