// CE0 / Simple Cellular Automaton on a Plane '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 {<-100, 100, -80> color <1, 1, 1>} camera { location <0, 0, -180> angle 90 look_at <0, -80, 0> } #declare Nmax = 270; #declare Nmay = 310; #declare Cp = array[2*Nmax][2]; #declare Nx = 0; #while (Nx < 2*Nmax) #declare Nz = 0; #while (Nz < 2) #declare Cp[Nx][Nz] = 0; #declare Nz = Nz+1; #end #declare Nx = Nx+1; #end #declare Cp[Nmax][0] = 1; union { sphere {<0, -Nmay/2, 0>, 1/4} #declare Ny = 1; #while (Ny < Nmay) #declare Nx = 0; #while (Nx < 2*Nmax) #declare Cp[Nx][1] = mod(Cp[mod(Nx-1+2*Nmax,2*Nmax)][0] +Cp[mod(Nx+1, 2*Nmax)][0] +Cp[Nx][0], 4); #if (Cp[Nx][1] > 0) sphere {, Cp[Nx][1]/4} #end #declare Nx = Nx+1; #end #declare Nx = 0; #while (Nx < 2*Nmax) #declare Cp[Nx][0] = Cp[Nx][1]; #declare Nx = Nx+1; #end #declare Ny = Ny+1; #end pigment {color rgb <1, 0.2, 0>} finish { reflection 0.8 phong 1 brilliance 1 ambient 0.3 } no_shadow rotate x*60 } background {color rgb <0, 0, 0.1>}