// Last edited on DATE TIME by USER // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_preta = texture{ pigment{ color rgb < 1, 1, 1 > } } #declare tx_vermelha = texture{ pigment{ color rgb < 1.00, 0, 0 > } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_verde = texture{ pigment{ color rgb < 0, 1, 0 > } } #declare tx_azul = texture{ pigment{ color rgb < 0, 0, 1.00 > } } #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{ <-20,-20,-1>, <+20,+20,0> } #macro bit (valor, defeito) #if (defeito = 1) union { cylinder{ < 0, 0, 0 >, < 0, 0, 2 >, 0.25 texture{ tx_azul } } sphere{ <0,0,0>, 0.5 translate <0,0,1> texture{ tx_vermelha } } } #else union { cylinder{ < 0, 0, 0 >, < 0, 0, 2 >, 0.25 texture{ tx_azul } } sphere{ <0,0,0>, 0.5 translate <0,0,0.5 + valor*1> texture{ tx_fosca } } } #end #end #macro fileira (n, valor, prob) union { #local i = 0; #local numero = n; #local r = int(valor); #local f = valor - r; #while(numero != 0) #local def = ( rand(semente) < prob); #local vb = mod(r,2); #if (vb = 0) object {bit(f,def) translate <0, (n/2)-0.5-i, 0>} #local f = 0; #else object {bit(1-f,def) translate <0, n/2-0.5-i, 0>} #end #local i = i + 1; #local r = int(r/2); #local numero = numero - 1; #end } #end #macro abaco (m, n, valores, prob) union { #local i = 0; #local teste = 0; #local loop = m; difference { box{ < -0.75,(-0.5*n)-0.5, (-2*m/2)-0.5 >, <0.75,(0.5*n)+0.5,(2*m/2)+0.5> texture{ tx_azul } } box{ < -0.8,(-0.5*n),(-2*m/2) >, <0.8,(0.5*n),(2*m/2)> texture{ tx_azul } } } #while(loop != 0) object {fileira(n, valores[teste],prob) translate <0, 0, (2*m/2)-2-i> } #local teste = teste + 1; #local i = i + 2; #local loop = loop - 1; #end } #end #declare valores = array [4] #declare valores[0] = (1-clock)*11 + clock*15; #declare valores[1] = (1-clock)*0 + clock*7; #declare valores[2] = (1-clock)*10 + clock*18; #declare valores[3] = (1-clock)*0 + clock*11; #declare valores1 = array [5] #declare valores1[0] = (1-clock)*0 + clock*7; #declare valores1[1] = (1-clock)*0 + clock*15; #declare valores1[2] = (1-clock)*0 + clock*31; #declare valores1[3] = (1-clock)*0 + clock*63; #declare valores1[4] = (1-clock)*11 + clock*257; #declare semente = seed(417); union { object{ abaco(4, 6, valores,0.1) translate <0, 10, 0>} object{ abaco(5, 8, valores1,0.15) translate <0, -10, 0>} object{ chao translate < 0,0,-6 > texture{ tx_xadrez } } } #include "eixos.inc" #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 23.0; #declare dir_camera = < (1-clock)*5 + clock*40, (1-clock)*-9 + clock*9, 4.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)