POV-Ray : Newsgroups : povray.unofficial.patches : Being able to call DLLs/SOs as user defined functions : Re: Being able to call DLLs/SOs as user defined functions Server Time
19 Apr 2024 07:32:09 EDT (-0400)
  Re: Being able to call DLLs/SOs as user defined functions  
From: bugman
Date: 19 Apr 2011 18:05:01
Message: <web.4dae068efa289b21d1576610@news.povray.org>
Thank you Warp. For some reason, I did not get your reply until after I posted
my last message. Anyway, that 'select' function is just the thing I've been
looking for. Using this approach, I was able to render a Mandelbulb in PovRay.
The following code is not very efficient, but it's an interesting demonstration.
Try it out!:

//runtime: 4 minutes, image size: 320x240
camera{location <-2.5,5,5> look_at <-0.5,0,0.25> up z sky z angle 25}
#declare f=function(i,x,y,z,xc,yc,zc) {select(i>0 & x*x+y*y+z*z<4, 0,
isosurface{function{f(24,x,y,z,x,y,z)-2} threshold 0 max_gradient 10
contained_by{sphere{<-0.5,0,0>,2}} pigment{rgb 1}}

In the process, I discovered something strange and evil about POV-Ray functions.
If I declare any helper functions before my 'f' function, everything goes
haywire. I'm not sure why this is, but it took me quite a while to discover this

Post a reply to this message

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