|
|
Hi Tor,
Tor Olav Kristensen <tor### [at] TOBEREMOVEDgmailcom> wrote:
> Woaw ! That's nice. AFAIR from the pre-beta test period for v3.5,
> it should not be possible for users to define recursive functions.
>
> But obviously this has changed since then. (Unintentionally ?)
>
>
I haven't seen this change in any of the change-logs, maybe it's an 'Easter
Egg' :-)
There's an nice variation I remembered from my days playing with Fractint,
so I went looking ...
[Mandelbrot code snipped]
>
> --
> Tor Olav
> http://subcube.net
> http://subcube.com
// start of code
#version 3.6;
#include "colors.inc"
// returns the 'potential' surface from 'Fractint'
#declare IterFn =
function(N, Max, Bail, Slope, Re, Im, Zr, Zi) {
select(
N = Max | sqrt(Zr*Zr + Zi*Zi) > Bail,
0,
IterFn(N + 1, Max, Bail, Slope, Re, Im, Zr*Zr - Zi*Zi + Re, 2*Zr*Zi +
Im),
min(1,select(N = Max, 0, pow(log(sqrt(Zr*Zr +
Zi*Zi))/pow(2,N),Slope), 0))
)
}
#declare MandelFn = function(Re, Im, Max, Bail, Slope) { IterFn(0, Max,
Bail, Slope, Re, Im, Re, Im) }
isosurface {
function { y + MandelFn(x-0.7, z, 500, 2000, 0.6) }
contained_by { box {-<3,1,3>,<3,0,3> } }
max_gradient 6.5
pigment {
function { 1-MandelFn(x-0.7, z, 500, 2000, 0.3) }
color_map {
[ 0.0 color Black ]
[ 0.25 color Cyan ]
[ 0.5 color Magenta ]
[ 0.75 color Yellow ]
[ 1.0 color White ]
}
}
rotate 10*z
rotate -50*x
translate 3*z
}
background { rgb <.5,.6,.7> }
light_source { <-2,4,0>*100 colour rgb 1 }
// end of code
Post a reply to this message
|
|