// Last edited on DATE TIME by USER // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #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 tx_preto = texture{ pigment{ color rgb < 0.00, 0.00, 0.00 > } } #declare fino = 0.100; #declare valores = array[10]; #declare valores[0] = (1 - clock)*1 + clock*2; #declare valores[1] = (1 - clock)*3 + clock*4; #declare valores[2] = (1 - clock)*5 + clock*6; #declare valores[3] = (1 - clock)*7 + clock*8; #declare valores[4] = (1 - clock)*9 + clock*10; #declare valores[5] = (1 - clock)*11 + clock*12; #declare valores[6] = (1 - clock)*13 + clock*14; #declare valores[7] = (1 - clock)*15 + clock*16; #declare valores[8] = (1 - clock)*17 + clock*18; #declare valores[9] = (1 - clock)*19 + clock*20; #declare roleta = seed(417); #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #macro botao(a) box{ <0, -0.5 , -0.5>, <0.1, 0.5, 0.5>} texture{ tx_plastico } rotate #end #macro bit(valor, def) union{ #if (def = 0) object{ botao(valor * 45) } #end } #end #macro fileira(n, valor, prob) #local i = n; #local r = int(valor); #local f = valor - r; union{ #while (i > 0) #local def = (rand(roleta) < prob); #local aux = mod(r, 2); #if (aux = 0) object{ bit(f, def) translate <0, (n - i) * -2, 0>} #local f = 0; #else object{ bit(1 - f, def) translate <0, (n - i) * -2, 0>} #end #local r = int(r/2); #local i = i - 1; #end } #end #macro abaco(m, n, valores, prob) #local j = m; #local i = n; union{ cylinder{ <0, 0, -1> <0, -n*2, -1> fino texture{ tx_plastico } translate <0 , 1 , 0> } cylinder{ <0, 0, 2*m - 0.5> <0, -n*2, 2*m - 0.5> fino texture{ tx_plastico } translate <0 , 1 , 0> } cylinder{ <0, -n*2, 2*m - 0.5> <0, -n*2, -1> fino texture{ tx_plastico } translate <0 , 1 , 0> } cylinder{ <0, 0, 2*m - 0.5> <0, 0, -1> fino texture{ tx_plastico } translate <0 , 1 , 0> } #while(i > 0) cylinder{ <0, 0, 2*m - 0.5> <0, 0, -1> fino texture{ tx_plastico } translate <0 , (-2*i) + 2 , 0> } #local i = i - 1; #end #while (j > 0) object{fileira (n, valores[j - 1], prob) translate<0, 0, (m - j) * 2> } #local j = j - 1; #end } #end #include "eixos.inc" union{ object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } object {abaco (10, 10, valores, 0.1)} } #include "camlight.inc" #declare centro_cena = < 0.00, -10.00, 10.00 >; #declare raio_cena = 20.0; #declare dir_camera = < clock * 14.00, (1 - clock) * 14.00, 0.00 >; #declare dist_camera = 14.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)