/* -------------------------- Entry: 0019 WWW: http://www.informatik.uni-bremen.de/~hobold/misc/animenger3.pov Title: Infinite Decomposition Author: Holger Bettag Infinite Decomposition A Fractal Animation by Holger Bettag The scene file "animenger0.pov", when rendered as per the rules of the POVRay Fractal Raytracing Contest, will produce your standard boring approximation of a Menger Sponge. I am not even sure wether it can be rendered within 10 hours, because the fairly low antialiasing threshold of the competition's standard ini file will cause each and every pixel of my scene to be supersampled, thanks to a noisy background and mostly reflective surfaces of the Menger Sponge. I wanted to release it here mostly to give it into the hands of people who like this kind of thing. I had quite a bit of trouble to trim the scene file down to the requested size limit; a more readable version of the scene file can be downloaded here: http://www.informatik.uni-bremen.de/~hobold/misc/animenger3.pov And the full animation is here http://www.informatik.uni-bremen.de/~hobold/animenger.mpg Or at least it will be once the competition is over. Use a movie player that can loop seamlessly! Despite its simplicity, the Infinite Decomposition can be almost hypnotizing to watch, as your mind tries to make sense of it. :-) ---------------------------*/ #global_settings {assumed_gamma 1 max_trace_level 15} camera {location<-1.8,1.2,-2.2> direction<0,0,2> up<0,4/3,0> right<4/3,0,0> sky<0,1,0> look_at<0,-.11,0>} #local c=clock; #local h=pow(1-pow(c-1,2),2); #local grav=1; #local dl=0; #local dm=.1; #local dh=.2; #macro dc ( dy ) (max(0,c-dy)) #end #macro fc ( dy,k ) #if (k+d,<3,3,m>+d,+d} triangle{+d,<-h,h,m>+d,+d} triangle{+d,+d,<-h,-h,m>+d} triangle{<-h,-h,m>+d,+d,<-h,h,m>+d} triangle{+d,<3,m,m>+d,+d} triangle{+d,<-h,-h,m>+d,+d} triangle{<3,m,m>+d,<3,3,m>+d,+d} triangle{+d,<3,3,m>+d,+d} triangle{<-h,h,m>+d,+d,+d} triangle{+d,<-h,h,-h>+d,<-h,h,m>+d} triangle{<-h,-h,m>+d,+d,+d} triangle{+d,<-h,-h,-h>+d,<-h,-h,m>+d} triangle{+d,+d,+d} triangle{+d,+d,+d} triangle{<-h,h,m>+d,<-h,-h,m>+d,<-h,-h,-h>+d} triangle{<-h,-h,-h>+d,<-h,h,-h>+d,<-h,h,m>+d} triangle{+d,<3,3,3>+d,+d} triangle{+d,<-h,h,3>+d,+d} triangle{+d,+d,<-h,-h,3>+d} triangle{<-h,-h,3>+d,+d,<-h,h,3>+d} triangle{+d,<3,m,3>+d,+d} triangle{+d,<-h,-h,3>+d,+d} triangle{<3,m,3>+d,<3,3,3>+d,+d} triangle{+d,<3,3,3>+d,+d} triangle{<-h,h,3>+d,+d,+d} triangle{+d,<-h,h,h>+d,<-h,h,3>+d} triangle{<-h,-h,3>+d,+d,+d} triangle{+d,<-h,-h,h>+d,<-h,-h,3>+d} triangle{+d,+d,+d} triangle{+d,+d,+d} triangle{<-h,h,3>+d,<-h,-h,3>+d,<-h,-h,h>+d} triangle{<-h,-h,h>+d,<-h,h,h>+d,<-h,h,3>+d} triangle{+d,<3,m,3>+d,+d} triangle{+d,<-h,m,h>+d,+d} triangle{+d,+d,<-h,m,-h>+d} triangle{<-h,m,-h>+d,+d,<-h,m,h>+d} triangle{+d,<3,m,m>+d,+d} triangle{+d,<-h,m,-h>+d,+d} triangle{<3,m,m>+d,<3,m,3>+d,+d} triangle{+d,<3,m,3>+d,+d} triangle{<-h,m,h>+d,+d,+d} triangle{+d,<-h,-h,h>+d,<-h,m,h>+d} triangle{<-h,m,-h>+d,+d,+d} triangle{+d,<-h,-h,-h>+d,<-h,m,-h>+d} triangle{+d,+d,+d} triangle{+d,+d,+d} triangle{<-h,m,h>+d,<-h,m,-h>+d,<-h,-h,-h>+d} triangle{<-h,-h,-h>+d,<-h,-h,h>+d,<-h,m,h>+d} triangle{+d,<3,3,3>+d,+d} triangle{+d,<-h,3,h>+d,+d} triangle{+d,+d,<-h,3,-h>+d} triangle{<-h,3,-h>+d,+d,<-h,3,h>+d} triangle{+d,<3,3,m>+d,+d} triangle{+d,<-h,3,-h>+d,+d} triangle{<3,3,m>+d,<3,3,3>+d,+d} triangle{+d,<3,3,3>+d,+d} triangle{<-h,3,h>+d,+d,+d} triangle{+d,<-h,h,h>+d,<-h,3,h>+d} triangle{<-h,3,-h>+d,+d,+d} triangle{+d,<-h,h,-h>+d,<-h,3,-h>+d} triangle{+d,+d,+d} triangle{+d,+d,+d} triangle{<-h,3,h>+d,<-h,3,-h>+d,<-h,h,-h>+d} triangle{<-h,h,-h>+d,<-h,h,h>+d,<-h,3,h>+d} triangle{+d,+d,+d} triangle{+d,+d,+d} triangle{+d,+d,+d} triangle{+d,+d,+d} triangle{+d,+d,+d} triangle{+d,+d,+d} triangle{+d,+d,+d} triangle{+d,+d,+d} triangle{+d,+d,<-h,h,h>+d} triangle{<-h,h,h>+d,<-h,-h,h>+d,+d} triangle{+d,+d,<-h,h,-h>+d} triangle{<-h,h,-h>+d,<-h,-h,-h>+d,+d} triangle{+d,+d,<-h,h,-h>+d} triangle{<-h,h,-h>+d,<-h,h,h>+d,+d} triangle{+d,+d,<-h,-h,-h>+d} triangle{<-h,-h,-h>+d,<-h,-h,h>+d,+d} triangle{<3,m,3>+d,<3,3,3>+d,<3,h,h>+d} triangle{<3,h,h>+d,<3,-h,h>+d,<3,m,3>+d} triangle{<3,m,m>+d,<3,m,3>+d,<3,-h,-h>+d} triangle{<3,-h,-h>+d,<3,m,3>+d,<3,-h,h>+d} triangle{<3,m,m>+d,<3,3,m>+d,<3,h,-h>+d} triangle{<3,h,-h>+d,<3,-h,-h>+d,<3,m,m>+d} triangle{<3,3,m>+d,<3,3,3>+d,<3,h,-h>+d} triangle{<3,h,-h>+d,<3,3,3>+d,<3,h,h>+d} triangle{<3,-h,h>+d,<3,h,h>+d,+d} triangle{+d,+d,<3,-h,h>+d} triangle{<3,-h,-h>+d,<3,h,-h>+d,+d} triangle{+d,+d,<3,-h,-h>+d} triangle{<3,h,h>+d,<3,h,-h>+d,+d} triangle{+d,+d,<3,h,h>+d} triangle{<3,-h,h>+d,<3,-h,-h>+d,+d} triangle{+d,+d,<3,-h,h>+d} #end #macro l2 (d) l1 (<0,6,6>+d ) l1 (<0,6,-6>+d ) l1 (<6,6,0>+d ) l1 (<-6,6,0>+d ) l1 (<-6,6,-6>+d ) l1 (<-6,6,6>+d ) l1 (<6,6,-6>+d ) l1 (<6,6,6>+d ) l1 (<0,-6,6>+d ) l1 (<0,-6,-6>+d ) l1 (<6,-6,0>+d ) l1 (<-6,-6,0>+d ) l1 (<-6,-6,-6>+d ) l1 (<-6,-6,6>+d ) l1 (<6,-6,-6>+d ) l1 (<6,-6,6>+d ) l1 (<6,0,6>+d ) l1 (<6,0,-6>+d ) l1 (<-6,0,6>+d ) l1 (<-6,0,-6>+d ) #end #local l3=mesh{ l2 (<0,18,18>) l2 (<0,18,-18>) l2 (<18,18,0>) l2 (<-18,18,0>) l2 (<-18,18,-18>) l2 (<-18,18,18>) l2 (<18,18,-18>) l2 (<18,18,18>) l2 (<0,-18,18>) l2 (<0,-18,-18>) l2 (<18,-18,0>) l2 (<-18,-18,0>) l2 (<-18,-18,-18>) l2 (<-18,-18,18>) l2 (<18,-18,-18>) l2 (<18,-18,18>) l2 (<18,0,18>) l2 (<18,0,-18>) l2 (<-18,0,18>) l2 (<-18,0,-18>) scale (1/54)} #local l4=union{ object{l3 translate<0,1,1>} object{l3 translate<0,1,-1>} object{l3 translate<1,1,0>} object{l3 translate<-1,1,0>} object{l3 translate<-1,1,-1>} object{l3 translate<-1,1,1>} object{l3 translate<1,1,-1>} object{l3 translate<1,1,1>} object{l3 translate<0,-1,1>} object{l3 translate<0,-1,-1>} object{l3 translate<1,-1,0>} object{l3 translate<-1,-1,0>} object{l3 translate<-1,-1,-1>} object{l3 translate<-1,-1,1>} object{l3 translate<1,-1,-1>} object{l3 translate<1,-1,1>} object{l3 translate<1,0,1>} object{l3 translate<1,0,-1>} object{l3 translate<-1,0,1>} object{l3 translate<-1,0,-1>} scale (1/3)} #local l5=union{ object{l4 translate<0,1,1>} object{l4 translate<0,1,-1>} object{l4 translate<1,1,0>} object{l4 translate<-1,1,0>} object{l4 translate<-1,1,-1>} object{l4 translate<-1,1,1>} object{l4 translate<1,1,-1>} object{l4 translate<1,1,1>} object{l4 translate<0,-1,1>} object{l4 translate<0,-1,-1>} object{l4 translate<1,-1,0>} object{l4 translate<-1,-1,0>} object{l4 translate<-1,-1,-1>} object{l4 translate<-1,-1,1>} object{l4 translate<1,-1,-1>} object{l4 translate<1,-1,1>} object{l4 translate<1,0,1>} object{l4 translate<1,0,-1>} object{l4 translate<-1,0,1>} object{l4 translate<-1,0,-1>} scale (1/3)} #undef l4 #local collection=union{ object{l5 b (dh+.0125,<0,0,1>,360*,50*rand(R1)) translate<0,1,1>} object{l5 b (dh+.0625,<-0.5,0,-1>,360*,50*rand(R1)) translate<0,1,-1>} object{l5 b (dh+.075,<1,0,.5>,360*,50*rand(R1)) translate<1,1,0>} object{l5 b (dh+.025,<-1,0,0>,360*,50*rand(R1)) translate<-1,1,0>} object{l5 b (dh+.05,<-1,0,-1>,360*,50*rand(R1)) translate<-1,1,-1>} object{l5 b (dh,<-1,0,1>,360*,50*rand(R1)) translate<-1,1,1>} object{l5 translate<1,1,-1>} object{l5 b (dh+.0375,<1,0,1>,360*,50*rand(R1)) translate<1,1,1>} object{l5 b (dl+.0125,<0,0,1>,360*,50*rand(R1)) translate<0,-1,1>} object{l5 b (dl+.0625,<0,0,-1>,360*,50*rand(R1)) translate<0,-1,-1>} object{l5 b (dl+.075,<1,0,0>,360*,50*rand(R1)) translate<1,-1,0>} object{l5 b (dl+.025,<-1,0,0>,360*,50*rand(R1)) translate<-1,-1,0>} object{l5 b (dl+.0375,<-1,0,-1>,360*,50*rand(R1)) translate<-1,-1,-1>} object{l5 b (dl,<-1,0,1>,360*,50*rand(R1)) translate<-1,-1,1>} object{l5 b (dl+.0875,<1,0,-1>,360*,50*rand(R1)) translate<1,-1,-1>} object{l5 b (dl+.05,<1,0,1>,360*,50*rand(R1)) translate<1,-1,1>} object{l5 b (dm+.06,<1,0,1>,360*,50*rand(R1)) translate<1,0,1>} object{l5 b (dm+.09,<1,0,-1>,360*,50*rand(R1)) translate<1,0,-1>} object{l5 b (dm,<-1,0,1>,360*,50*rand(R1)) translate<-1,0,1>} object{l5 b (dm+.03,<-1,0,-1>,360*,50*rand(R1)) translate<-1,0,-1>} scale (1/3) #local axispos=c*c*(-2*c+3)/3*(x-z); translate -axispos rotate c*90*y translate axispos translate c*c*(-2*c+3)*2/3*(-x) translate<.5,-.5,.5> scale pow(3,c) translate<-.5,.5,-.5>} object{collection texture{pigment{color rgb<.2,.4,.9>} finish{ambient 0 diffuse .5 reflection .75 specular .7}}} light_source{<-500,10000,-750>color rgb<1,.8,.8>} light_source{<-250,-500,-8000>color rgb<.8,1,.8>} light_source{<10000,-500,-200>color rgb<.8,.8,1.0>} #local R1=seed(25770); #local f=.2; sky_sphere{pigment{average pigment_map{[1.0 granite color_map{[0 color rgb<0,0,0>] [1 color rgb<3,0,0>]} translate<70,0,0> rotate<360*rand(R1),360*rand(R1),360*rand(R1)> rotate<0,360*(rand(R1)-f),360*(rand(R1)+f)> rotate<360*rand(R1),360*rand(R1),360*rand(R1)> scale 1+0.2*sin((1/3+f)*2*pi*3)] [1.0 granite color_map{[0 color rgb<0,0,0>] [1 color rgb<0,3,0>]} translate<0,50,0> rotate<360*rand(R1),360*rand(R1),360*rand(R1)> rotate<360*(rand(R1)+f),0,360*(rand(R1)+f)> rotate<360*rand(R1),360*rand(R1),360*rand(R1)> scale 1+0.2*sin((2/3+f)*2*pi*4)] [1.0 granite color_map{[0 color rgb<0,0,0>] [1 color rgb<0,0,3>]} translate<0,0,30> rotate<360*rand(R1),360*rand(R1),360*rand(R1)> rotate<360*(rand(R1)+f),360*(rand(R1)-f),0> rotate<360*rand(R1),360*rand(R1),360*rand(R1)> scale 1+0.2*sin(f*2*pi*5)]} scale 1.5}} background{color rgb<.05,.05,.15>}