// Last edited on DATE TIME by USER // Processed by remove-cam-lights #declare roleta = seed(417); background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_preto = texture{ pigment{ color rgb < 0, 0, 0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1,1,1 > } 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 > } scale 2.0 } #macro criaBastao (temp, erro) #local def = (rand(roleta) < erro); #if (def = 1) cylinder { <0,-2,0.8>, <0,6,0.8>, 0.2 texture { tx_vidro }} #else union { cylinder { <0,-2,0.8>, <0,6,0.8>, 0.2 texture { tx_vidro }} cylinder { <0,4.9,0.8>, <0,5.9,0.8>, 0.3 texture { tx_xadrez } translate (1-temp*8)*y} } #end #end #macro abaco() union { difference { box {<-2,-2,-2>, <3,6,2> texture { tx_fosca } } box { <-2.1,-1.5,-1.5>, <3.1,5.5,1.5> texture { tx_fosca }} } } #end #macro bastoes(fileiras, numero, erro) union { #local r = int(numero); #local f = numero - r; #local k = 0; #while (k < fileiras) #local vv = mod(r,2); #if (vv = 0) object { criaBastao(f, erro) translate 0.5*-k*z } #local f = 0; #else object { criaBastao(1-f, erro) translate 0.5*-k*z } #end #local r = r/2; #local k = k + 1; #end } #end #macro variasFilas (i, j, erro) union { #local temp = i; #while (temp > 0) #local temp2 = 0; #local temp3 = 1; object { bastoes (j, (1-clock)*temp2+clock*temp3, erro) translate temp*1.2*x } #local temp = temp - 1; #end } #end object { variasFilas(3, 5, 0.00001) } #include "eixos.inc" #include "camlight.inc" #declare centro_cena = < 7.00, 0.00, 1.00 >; #declare raio_cena = 5*(1-clock) + 11*clock; #declare dir_camera = <3, 3, 5 >; #declare dist_camera = 50.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)