POV-Ray : Newsgroups : povray.binaries.images : Shortest code ever for mandel landscape made of spheres : Re: Shortest code ever for mandel landscape made of spheres Server Time
19 Aug 2024 04:24:43 EDT (-0400)
  Re: Shortest code ever for mandel landscape made of spheres  
From: Mr  Art
Date: 18 Jan 2001 07:25:49
Message: <3A67172B.4FBD85F@chesapeake.net>
I am getting a new mental image of why you sign your
posts thhe way you do.

Warp wrote:
> 
>   For very long time I thought that this was the shortest way of getting
> a decent-looking mandelbrot landscape made of spheres with MegaPov:
> 
> camera{location 2look_at 0}light_source{9,1}$R=-2;#while(R<1)$I=-2;#while
> (I<2)$A=R;$B=I;$N=0;#while($T=B*B;N<9&A*A+T<4)$B=2*A*B+I;$A=A*A-T+R;$N=
> N+1;#end sphere{<R,N/9,I>.02pigment{bozo}}$I=I+.03;#end$R=R+.03;#end
> 
>   However, I just realized that I have been wrong all the time. There's a
> much shorter way of doing the same:
> 
> camera{location 2look_at 0}light_source{9,1}$R=-2;#while
> (R<1)$I=-2;#while(I<2)sphere{<R,eval_pattern(mandel 9,
> <R,I>),I>.02pigment{bozo}}$I=I+.03;#end$R=R+.03;#end
> 
>   In practice this makes the exact same thing as the previous. (Images made
> with both codes included at the end of the article.)
> 
>   By the way, can you guess what does this code do without rendering it?
> (Answer forwared to this article)
> 
> #macro A()int(rand(R)*4)*90#end$P=union{torus{1,.05translate<1,0,-1>}
> torus{1,.05translate<-1,0,1>}cylinder{-y,y,.05}clipped_by{box{-1,1}}}
> $R=seed(1);light_source{<99,30,-30>1}camera{location<9,6,-13>look_at
> 0angle 35}$Z=-11;#while(Z<21)$Y=-11;#while(Y<12)$X=-13;#while(X<12
> )object{P rotate<A(),A(),A()>translate<X,Y,Z>no_shadow pigment{
> rgb<1,.5>}finish{specular.5}}$X=X+2;#end$Y=Y+2;#end$Z=Z+2;#end
> 
>  [Image]
> 
>  [Image]
> 
> --
> char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
> main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
> c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

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