POV-Ray : Newsgroups : povray.newusers : isosurfaces? : Re: isosurfaces? Server Time
2 Nov 2024 17:19:02 EDT (-0400)
  Re: isosurfaces?  
From: Christoph Hormann
Date: 4 Nov 2003 05:32:02
Message: <afbk71-cd6.ln1@triton.imagico.de>
Tom Melly wrote:
> [...]
> 
> #declare FSphere=function (x,y,z,R) {pow(x*x+y*y+z*z,0.5) - R}
> isosurface
> {
>   function{FSphere(x,y,z,2)}
>   threshold 0
>   contained_by {box {-5,5}}
>   max_gradient 13
>   texture{
>     pigment{color rgb .6}
>   }
> }

Actually you should use sqrt() instead of pow(,0.5).

And since the radius R is a render time constant it is not necessary for 
it to be a parameter:

#declare R=2;

#declare FSphere=function {sqrt(x*x+y*y+z*z) - R}

isosurface
{
   function{FSphere(x,y,z)}
   ...
}

And this is exctly how it is shown in the isosurface tutorial in the 
documentation.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 25 Oct. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

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