|
![](/i/fill.gif) |
On Fri, 14 Dec 2001 01:09:58 +0100, Tor Olav Kristensen
<tor### [at] hotmail com> wrote:
> Btw.: Does anyone (Warp ?) know if it currently
> is possible to make recursive functions in v3.5 ?
I have used recursive functions in
http://news.povray.org/fnpb0u87q8fuome5fruo6tp2mf83jsoprp@4ax.com
ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)&_((x+y)*.7,z,.1)&_((x+y+2)*.7,z,.1)&_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Tue, 18 Dec 2001 02:35:29 +0100, Tor Olav Kristensen <tor### [at] hotmail com>
wrote:
> It would be interesting to see
> the function for those.
it wasn't real recursive function but unrolled one. Just set of identical
functions called according to condition.
> Source please ?
#declare L1=.3;
#declare L2=.3;
#declare L3=.3;
#declare L4=.3;
#declare R=.4;
#declare f_level_4=function{
select(
f_noise3d(19*floor(x),20*floor(y),21*floor(z))-L4,
f_sphere(x-(floor(x)+.5),y-(floor(y)+.5),z-(floor(z)+.5),R),
1
)
}
#declare f_level_3=function{
select(
f_noise3d(16*floor(x),17*floor(y),18*floor(z))-L3,
f_sphere(x-(floor(x)+.5),y-(floor(y)+.5),z-(floor(z)+.5),R),
f_level_4(x*2,y*2,z*2)
)
}
#declare f_level_2=function{
select(
f_noise3d(13*floor(x),14*floor(y),15*floor(z))-L2,
f_sphere(x-(floor(x)+.5),y-(floor(y)+.5),z-(floor(z)+.5),R),
f_level_3(x*2,y*2,z*2)
)
}
#declare f_level_1=function{
select(
f_noise3d(10*floor(x),11*floor(y),12*floor(z))-L1,
f_sphere(x-(floor(x)+.5),y-(floor(y)+.5),z-(floor(z)+.5),R),
f_level_2(x*2,y*2,z*2)
)
}
#local N=2;
isosurface{
function{f_level_1(x,y,z)}
contained_by{box{-N,N}}
max_gradient 5
evaluate 1, 10, 0.99
scale 1.1/N
rotate 30*y
rotate -10*x
texture { T_Glass1 } interior { I_Glass1 }
no_shadow
}
ABX
Post a reply to this message
|
![](/i/fill.gif) |