// CE0 / a Tree of Tetrahedrons by Cellular Automaton '08.02 // by Tsutomu HIGO URL:http://www.asahi-net.or.jp/~nj2t-hg/ #version 3.6; global_settings { assumed_gamma 2.2 max_trace_level 5 } light_source {<-50, 250, -1000> color <1, 1, 1>} camera { location <2, 70, -60> angle 82 look_at <7, 50, 0> } #declare Block = union { triangle {<-0.5, -0.5/1.732, -0.5/1.732>, <0.5, -0.5/1.732, -0.5/1.732>, <0, -0.5/1.732, 1.732/2-0.5/1.732>} triangle {<-0.5, -0.5/1.732, -0.5/1.732>, <0.5, -0.5/1.732, -0.5/1.732>, <0, 1.732/2-0.5/1.732, 0>} triangle {<-0.5, -0.5/1.732, -0.5/1.732>, < 0, -0.5/1.732, 1.732/2-0.5/1.732>, <0, 1.732/2-0.5/1.732, 0>} triangle {< 0.5, -0.5/1.732, -0.5/1.732>, < 0, -0.5/1.732, 1.732/2-0.5/1.732>, <0, 1.732/2-0.5/1.732, 0>} rotate y*60 }; #declare Nmax = 43;//86; #declare Cp = array[2*Nmax][2][2*Nmax]; #declare Ny = 0; #while (Ny < 2) #declare Nx = 0; #while (Nx < 2*Nmax) #declare Nz = 0; #while (Nz < 2*Nmax) #declare Cp[Nx][Ny][Nz] = 0; #declare Nz = Nz+1; #end #declare Nx = Nx+1; #end #declare Ny = Ny+1; #end #declare Cp[Nmax][0][Nmax] = 1; union { union {Block pigment {color rgb <1, 1, 1>} finish { reflection 0.3 phong 1 brilliance 1 ambient 0.2 } } #declare Ny = 1; #while (Ny < Nmax-1) #declare Nx = Nmax-Ny-1; #while (Nx < Nmax+Ny+1) #declare Nz = Nmax-Ny-1; #while (Nz < Nmax+Ny+1) #declare Cp[Nx][1][Nz] = mod(Cp[mod(Nx+2*Nmax,2*Nmax)][0][Nz] +Cp[mod(Nx+1, 2*Nmax)][0][Nz] +Cp[Nx][0][mod(Nz+1, 2*Nmax)],5); #switch (Cp[Nx][1][Nz]) #case (1) union {Block translate pigment {color rgb <0.25, 0.25, 0.25>} finish { reflection 0.3 phong 1 brilliance 1 ambient 0.2 } } #break #case (2) union {Block translate pigment {color rgb <0.5, 0.5, 0.5>} finish { reflection 0.3 phong 1 brilliance 1 ambient 0.2 } } #break #case (3) union {Block translate pigment {color rgb <0.75, 0.75, 0.75>} finish { reflection 0.3 phong 1 brilliance 1 ambient 0.2 } } #break #case (4) union {Block translate pigment {color rgb <1, 1, 1>} finish { reflection 0.3 phong 1 brilliance 1 ambient 0.2 } } #break #end #declare Nz = Nz+1; #end #declare Nx = Nx+1; #end #declare Nx = Nmax-Ny-1; #while (Nx < Nmax+Ny+1) #declare Nz = Nmax-Ny-1; #while (Nz < Nmax+Ny+1) #declare Cp[Nx][0][Nz] = Cp[Nx][1][Nz]; #declare Nz = Nz+1; #end #declare Nx = Nx+1; #end #declare Ny = Ny+1; #end rotate x*180 rotate y*46 no_shadow } background {color rgb <1, 1, 1>}