// CE0 / Simple Reversible Cellular Automaton on a Torus '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 {<30, 0, -200> color <1, 1, 1>} camera { location <0, -40, -200> angle 108 look_at <-17, 28, -10> } #declare Nmay = 891+12; #declare Nmax = 144; #declare Rs=Nmax/pi; #declare Rl=Nmay*1.732/2/2/pi; #declare Cp = array[2*Nmax][2]; #declare Nx = 0; #while (Nx < 2*Nmax) #if (Nx=0) #declare Cp[Nx][0] = 1; #else #declare Cp[Nx][0] = 0; #end #declare Nx = Nx+1; #end #declare Object1 = union { sphere {, 0.6 pigment {color rgb <1, 1, 1>} finish { reflection 1 phong 1 brilliance 0.5 ambient 0.4 } } sphere {, 0.6 pigment {color rgb <1, 1, 0>} finish { reflection 0.2 phong 1 brilliance 0.5 ambient 0.4 } } }; #declare Object2 = union { sphere {, 0.6 pigment {color rgb <0.2, 0.4, 1>} finish { reflection 1 phong 1 brilliance 0.5 ambient 0.4 } } sphere {, 0.6 pigment {color rgb <0.1, 1, 0.3>} finish { reflection 0.2 phong 1 brilliance 0.5 ambient 0.4 } } }; union { union {Object1 rotate y*180/Nmax*0 translate x*Rl rotate z*360/Nmay*0} #declare Ny = 1; #while (Ny < Nmay-12) #declare Nx = 0; #while (Nx < 2*Nmax) #declare Cp[Nx][1] = mod(Cp[Nx][0]+Cp[mod(Nx+1, 2*Nmax)][0], 3); #if (Cp[Nx][1] = 1) union {Object1 rotate y*180/Nmax*(Nx+0.5*Ny) translate x*Rl rotate z*360/Nmay*Ny} #end #if (Cp[Nx][1] = 2) union {Object2 rotate y*180/Nmax*(Nx+0.5*Ny) translate x*Rl rotate z*360/Nmay*Ny} #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 no_shadow rotate x*90 rotate y*40 rotate z*30 } background {color rgb <0, 0, 0.3>}