// Last edited on DATE TIME by USER // Processed by remove-cam-lights #include "eixos.inc" #include "camlight.inc" #declare centro_cena = < 10.00, 10.00, +3.00 >; #declare tempo = array[9] {0.0, 0.125, 0.250, 0.375, 0.500, 0.625, 0.750, 0.825, 1.000}; #local dist_camera = (1-clock)*15 + clock*10; #local raio_cena = (1-clock)*20 * clock*15; #declare dir_camera = < -1.00, 10.00, 3.00 >; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz) background{ color rgb < 0.50, 0.50, 0.50 > } #declare cinza_brilhante = texture { pigment{ color rgb <0.50, 0.50, 0.50>} finish { diffuse 1 specular 0.5} } #declare vermelho_fosco = texture { pigment{ color rgb <1.00, 0.00, 0.00>} finish { diffuse 1 specular 0.2 } } #declare amarelo_fosco = texture { pigment{ color rgb <1.00, 1.00, 0.00>} finish { diffuse 1 specular 0.2 } } #declare tx_xadrez = texture { pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } #declare chao = box{ <-100,-100,-1>, <+100,+100,0>} #declare roleta = seed(313); #macro bit(pos_bit) #declare defeito = (rand(roleta) < prob); #if (defeito = 1) sphere{<0,0,0>,1 texture{vermelho_fosco}} #else sphere{<0,0,0>,1 texture{cinza_brilhante}} #end translate pos_bit #end #macro fileira_frac (valor,defeito,pos_fileira) #local vetor_bit = array[6]; #local valor_int = int(valor); #local frac = valor - valor_int; #local i = 0; #while (i < 6) #local valor_bit = mod(valor_int,2); #if (valor_bit = 0) #local vetor_bit[i] = frac; #local frac = 0; #else #local vetor_bit[i]= 1-frac; #end #local valor_int = int(valor_int/2); #local i = i+1; #end union { cylinder{<0,0,1>,<20,0,1>, 0.3 texture{cinza_brilhante}} object{ bit(<16+vetor_bit[5],0,1>)} object{ bit(<13+vetor_bit[4],0,1>)} object{ bit(<10+vetor_bit[3],0,1>)} object{ bit(<7+vetor_bit[2], 0,1>)} object{ bit(<4+vetor_bit[1], 0,1>)} object{ bit(<1+vetor_bit[0], 0,1>)} translate pos_fileira } #end #macro abaco (prob) union { box{< 0,0,0> , <22,2, 2> texture{cinza_brilhante}} box{<20,0,2> , <22,2,20> texture{cinza_brilhante}} box{<22,2,20>, <0,0,18> texture{cinza_brilhante}} box{<0,0,0> , <2,2,20> texture{cinza_brilhante}} object{fileira_frac(0,prob,<2,0,2>)} object{fileira_frac(1,prob,<2,0,4>)} object{fileira_frac(15, prob,<2,0,6>)} object{fileira_frac(15.5,prob,<2,0,8>)} object{fileira_frac(15.8,prob,<2,0,10>)} object{fileira_frac(16 ,prob,<2,0,12>)} object{fileira_frac(32,prob,<2,0,14>)} object{fileira_frac(63,prob,<2,0,16>)} } #end union { object{ eixos(3.00) } object{ chao translate < 0,0,-5> texture {tx_xadrez}} object{ abaco(0.0)} }