POV-Ray : Newsgroups : povray.advanced-users : Fractal isosurface Server Time
28 Dec 2024 00:08:15 EST (-0500)
  Fractal isosurface (Message 1 to 7 of 7)  
From: Andrew C on Mozilla
Subject: Fractal isosurface
Date: 20 Jun 2004 06:02:42
Message: <40d560c2$1@news.povray.org>
Hey folks...

I just made an isosurface in the shape of the quadratic Mandelbrot set. :-D

...but I did it the hard way! :-/

Due to the slightly bizzare way POV-Ray's macro feature works, you can 
actaully write this:

-----

#macro Cr() x #end
#macro Ci() y #end

#macro Zr(Iter)
   #if (Iter=0)
     Cr()
   #else
     ( Zr(Iter-1) * Zr(Iter-1) - Zi(Iter-1) * Zi(Iter-1) + Cr() )
   #end
#end

#macro Zi(Iter)
   #if (Iter=0)
     Ci()
   #else
     ( 2 * Zr(Iter-1) * Zi(Iter-1) + Ci() )
   #end
#end

#declare MaxIter = 1;

#declare Fn =
function {Zr(MaxIter) * Zr(MaxIter) + Zi(MaxIter) * Zr(MaxIter)}

-----

...which is actually equivilent to

#declare Fn =
function { ( x*x - y*y + x)*(x*x - y*y + x) + (2*x*y + y)*(2*x*y + y) }

Nothing exciting there. However, replace MaxIter=1 with MaxIter=2 and 
you get a more complicated expression... an expression too complicated 
for me to write out here. But it's the expression for 2 iterations of 
the complex quadratic map Z := Z^2 + C (in case that wasn't already 
obviouse.)

The above fails when MaxIter=10 (but works for 9). Actually, you can 
drastically speed up the parsing *and* rendering by using pow(..., 2) to 
do the squaring. (I don't know how high you can go then - but easily 
high enough for the resulting function to render indescribably slowly.)

You know how POV-Ray tells you the max gradient of an isosurface when it 
finishes? Well, I ran POV-Ray for (I think) MaxIter=5. The reported max 
gradient went into about 16 figures. (!!)

I seem to have fixed this by using min() and max() to limit Zr and Zi to 
+/-4. This has no effect on the part of the image that POV-Ray is 
actually trying to draw, but does prevent POV-Ray struggling to do 
computations with enoumouse numbers. It also results in a drastically 
smaller max gradient being reported.

(Actually, for MaxIter=5, POV-Ray says the max gradient should be 2,000. 
This is unspeakably slow to render. However, rendering with 50 seems to 
work just fine. Unless I'm very much mistaken, the max gradient near 
where the actual surfaces are is much less; the function only changes 
this rapidly round the edges, where the orbits have "escaped" to infinity.)

BTW, with the pow() speedup and the magnitude limiting, a 640x480 image 
with no AA is currently rendering at about 350 pixels/sec on my AMD 1.4 
GHz laptop. (...at least I *think* it's 1.4 GHz... might be lower... but 
definitely over 1 Ghz.)

..."and WHY are you doing this?" I hear you cry.

Well, firstly I want to make a Mandelbrot hight field isosurface-style. 
(*NO TRIANGLES*!) I can also do a similar thing with julibrot slices. 
(See FractInt if you don't know what I'm talking about...)

But secondly, and more importantly, I want to do the same trick to 
render 3D slices of the (4-dimensional) cubic Mandelbrot set(s). That 
is, the Mandelbrot set(s) of the mapping

   Z := Z^3 - 3(A^2)Z + B

I've always wanted to know what it would look like... (Well, actually 
I've *seen* it in a book, and it looks cool!)

Will post if I come up with any particularly interesting images.

Andrew @ home.


Post a reply to this message

From: Warp
Subject: Re: Fractal isosurface
Date: 20 Jun 2004 07:36:26
Message: <40d576b9@news.povray.org>
Wouldn't using the internal mandelbrot pattern speed up things a bit?

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Apache
Subject: Re: Fractal isosurface
Date: 20 Jun 2004 07:51:07
Message: <40d57a2b$1@news.povray.org>
Can we see a pic?

regards


Post a reply to this message

From: Andrew C on Mozilla
Subject: Re: Fractal isosurface
Date: 20 Jun 2004 08:17:05
Message: <40d58041@news.povray.org>
>   Wouldn't using the internal mandelbrot pattern speed up things a bit?

Hell yeah!

...but there *isn't* one for the cubic Mandelbrot...

Andrew @ home.

PS. I just remembered about the "select" function... I think I may be 
able to use this to truncate the computation of escaping orbits... the 
isosurface function will be yet more complex, but might well go a tad 
faster...


Post a reply to this message

From: Andrew C on Mozilla
Subject: Re: Fractal isosurface
Date: 20 Jun 2004 08:18:25
Message: <40d58091$1@news.povray.org>
> Can we see a pic?

Yups. I plan to run a few renders overnight, and post the results 
tomorrow (or their abouts).

Thanks.
Andrew @ home.

PS. Can you say "19 pixels/second"? :-S


Post a reply to this message

From: Andrew C on Mozilla
Subject: Re: Fractal isosurface
Date: 20 Jun 2004 12:20:15
Message: <40d5b93f$1@news.povray.org>
> Can we see a pic?

There's now a 3D Julibrot slice in povray.binaries.images. (Not very 
exciting, but took an extremely long time to render.)

Andrew @ home.


Post a reply to this message

From: Apache
Subject: Re: Fractal isosurface
Date: 20 Jun 2004 19:01:22
Message: <40d61742@news.povray.org>
Cool pic nevertheless!


Post a reply to this message

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