// 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_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_branca = texture{ pigment{ color rgb < 2, 2, 2> } } #declare tx_preta = texture{ pigment{ color rgb < 0, 0, 0> } } #declare tx_orelha = texture{ pigment{ color rgb < 0.80, 0.80, 0.8 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_madeira = texture{ pigment{ color rgb < 0.80, 0.55, 0.40 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 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 raio_bit = 0.25; #declare raio_marc = 0.4*raio_bit; #declare h = 0.3; #macro bit(um_ou_zero,px,py,pz,defeito) union { union { #if (defeito = 0) union { cylinder { , , raio_bit texture {tx_plastico} } cylinder { , raio_marc texture {tx_fosca} } } translate<-px,-py,-pz> rotate<0,75,0> translate translate<-raio_marc/2,0,0> #end } #if (um_ou_zero = 0) translate<-px+raio_marc/2,-py,-pz> rotate<0,180,0> translate translate<0.3,0,h/2> #end } #end #declare dist = 2.5*raio_bit; #declare clockl = clock; #macro fileira(n,valor,pz,chute) #local k = n; union { #while (k>0) #if (mod(valor,2) = 1) bit(1,-h,k*dist,pz,(rand (roleta) < chute)) #else bit(0,-h,k*dist,pz,(rand (roleta) < chute)) #end #local k = k - 1; #local valor = int(valor/2); #end } #end #declare qtd = 4; #declare valores = array[qtd] { 5 , 7 , 2 , 12 }; #macro estrutura(n_fil,bit_fil) union { fundo(n_fil,bit_fil) } #end #macro fundo(n_fil,bit_fil) union { difference { box { <-1,-1,-1> <0,bit_fil*dist,dist*n_fil+1> } box { <-0.8,-0.5,-0.8> <0.01,bit_fil*dist-0.5,dist*n_fil+0.8> } } texture { tx_madeira } } #end #macro abaco(n_fil,bit_fil,valores,chute) #local j = n_fil; union { object { estrutura(n_fil,bit_fil+2.3)} #while (j>0) fileira(bit_fil,ceil(clockl*(valores[j-1])),j*dist-0.3,chute) pino(bit_fil,j*dist-0.3) #local j = j - 1; #end } #end #declare r_pino = raio_bit/3; #macro pino(bit_fil,pz) #declare i_px = h/2; #declare i_py = -1; union { cylinder { <-i_px,i_py,pz>, <-i_px,bit_fil*dist+1,pz> r_pino } texture { tx_madeira } } #end #declare roleta = seed(1337); #include "eixos.inc" union { object { eixos(3.00) } object { abaco(qtd,5,valores,0) } rotate<0,0,22> } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 7*(1-clockl) + 11*clockl; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)