// CE0 / a Pyramid of Pyramids 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 4 } light_source {<-40, 30, -80> color <1, 1, 1>} camera { location <70, -56, -200> angle 72 look_at <16, -99, 0> } #declare Block = union { triangle {<-0.5, -0.5, -0.5>, <-0.5, -0.5, 0.5>, <0.5, -0.5, -0.5>} triangle {< 0.5, -0.5, 0.5>, <-0.5, -0.5, 0.5>, <0.5, -0.5, -0.5>} triangle {<-0.5, -0.5, -0.5>, <-0.5, -0.5, 0.5>, < 0, 0.5, 0>} triangle {<-0.5, -0.5, -0.5>, < 0.5, -0.5, -0.5>, < 0, 0.5, 0>} triangle {< 0.5, -0.5, 0.5>, <-0.5, -0.5, 0.5>, < 0, 0.5, 0>} triangle {< 0.5, -0.5, 0.5>, < 0.5, -0.5, -0.5>, < 0, 0.5, 0>} }; #declare Nmax = 64;//128; #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 rgbt <1, 0.5, 0.3, 0.6>} finish { reflection 0.8 phong 1 brilliance 1 ambient 0.3 } } #declare Ny = 1; #while (Ny < Nmax) #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-1+2*Nmax,2*Nmax)][0][Nz] +Cp[mod(Nx+1, 2*Nmax)][0][Nz] +Cp[Nx][0][mod(Nz-1+2*Nmax,2*Nmax)] +Cp[Nx][0][mod(Nz+1, 2*Nmax)],2); #if (Cp[Nx][1][Nz] = 1) union {Block translate pigment {color rgbt <1, 0.5, 0.3, 0.6>} finish { reflection 0.8 phong 1 brilliance 1 ambient 0.3 } } #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 y*268 no_shadow } background {color rgb <0, 0, 0.1>}