// Trem da alegria #include "colors.inc" // ====================================================================== // CÂMERA camera { location < 0,30 , 6.00 > // Posição do observador. //location < -30, 40 , 5.00 > right 1.00*x // Largura RELATIVA da imagem. up 0.5*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 4.00, 0.00, 4.00 > // Para onde a câmera está apontando. } // Nota: os parâmetros "right" e "up" devem ter a mesma proporção // que os parâmetros ${WIDTH} e ${HEIGHT} no Makefile. // ====================================================================== // FONTES DE LUZ light_source { 10 * < +50.0, +30.0, +50.0 > // Posição da lâmpada. color rgb 1.2 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { 10 * < +50.0, -10.0, -20.0 > // Posição da lâmpada. color rgb 0.8 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_aco = texture{ pigment{ Gray } finish{ ambient 0.05 diffuse 0.25 reflection Gray specular 0.20 roughness 0.05 } } #declare tx_ouro = texture{ pigment{ Gold } finish{ ambient 0.05 diffuse 0.3 reflection Gold specular 0.20 roughness 0.05 } } #declare tx_verdeb = texture{ pigment{ DarkGreen } finish{ ambient 0.05 diffuse 0.3 reflection DarkGreen specular 0.20 roughness 0.05 } } #declare tx_cristal = texture{ finish{ ambient 0.1 diffuse 0.1 reflection 0.25 specular 1 roughness 0.001 } pigment {color Brown filter 1} } #declare tx_cristal_azul = texture{ finish{ ambient 0.1 diffuse 0.1 reflection 0.25 specular 1 roughness 0.001 } pigment {color Yellow*0.4 filter 1} } #declare roda = union{ difference{ box{ <-1, -0.4, -1>, <1, 0.4, 1> texture{tx_ouro} } torus{ 2, 1.2 texture{tx_ouro} } } cylinder{ <0, -0.41, 0.4>, <0, 0.41, 0.4>, 0.2 texture {tx_aco} } cylinder{ <0, -0.41, -0.4>, <0, 0.41, -0.4>, 0.2 texture {tx_cristal} } } #declare eixo = union{ cylinder{ <0, 2.5, 0>, <0, -2.5, 0>, 0.5 texture{tx_aco} } object{roda translate<0, 2.5, 0>} object{roda translate<0, -2.5,0>} rotate <0, 9000*clock, 0> } #declare locomotiva = union{ difference{ box { < 0, 2.0, 0 >, < 4, -2, 8.0 > texture { tx_aco } } box{ < 0.5, 2.1, 4>, < 3.5, -2.1, 7.5> texture {tx_aco} } box{ < -0.1, 1.5, 4>, < 4.1, -1.5, 7.5> texture {tx_aco} } } cylinder{ <-4, 0, 2>, <0, 0, 2>, 2 texture {tx_aco} } #declare i = 0; #while (i < 4) object {eixo translate <-3+2*i, 0, 0>} #declare i = i + 1; #end cylinder{ <-2.5, 0, 3>, <-2.5, 0, 9>, 1 texture{tx_ouro} } torus{ 1.2, 0.3 texture{tx_aco} rotate <90, 0, 0> translate <-2.5, 0, 9> } cylinder{ <4, 0, 0.5>, <7, 0, 0.5>, 0.2 texture {tx_cristal_azul} } torus{ 1.8, 0.3 texture{tx_ouro} rotate <0, 0, 90> translate <-4, 0, 2> } } #declare vagao = union { difference{ box{ <-5, -2, 0>, <5, 2, 8> texture{tx_cristal} } box{ <-4.8, -1.8, 0.2>, <4.8, 1.8, 7.8> texture{tx_cristal} } #declare i = 0; #while (i < 5) box{ <-4.6+i*2, -2.1, 4>, <-3.4+i*2, 2.1, 7.5> texture{tx_cristal} } #declare i = i + 1; #end } difference{ cylinder{ <-5.5, 0, 6>, <5.5, 0, 6>, 4 texture{tx_ouro} } box{ <-7, -4.5, 0>, <7, 4.5, 8> texture{tx_cristal} } } #declare i = 0; #while (i < 5) object{eixo translate <-4+2*i, 0, 0>} #declare i = i + 1; #end cylinder{ <6, 0, 0.5>, <5, 0, 0.5>, 0.2 texture {tx_cristal_azul} } cylinder{ <-6, 0, 0.5>, <-5, 0, 0.5>, 0.2 texture {tx_cristal_azul} } #declare i = 0; #while (i<9) #declare j = 0; #while (j<3) text{ ttf "times.ttf" "$" 0.1,0 texture{tx_verdeb} rotate <90,0,0> scale 1.2 translate <-4.3+i*1, 2.1, 3-j> } text{ ttf "times.ttf" "$" 0.1,0 texture{tx_verdeb} rotate <90,0,0> scale 1.2 translate <-4.3+i*1, -2.1, 3-j> } #declare j = j +1; #end #declare i = i + 1; #end } #declare trilhos = union{ cylinder{ <-100, 2.5, -1>, <200, 2.5, -1>, 0.4 texture{tx_aco} } cylinder{ <-100, -2.5, -1>, <200, -2.5, -1>, 0.4 texture{tx_aco} } } #declare chao = plane { z, -1.3 texture{ pigment {brick pigment{boxed},pigment{granite}} finish {ambient 0.1 diffuse 0.9} scale 0.1 } } #declare eixosplano= union{ cylinder{ <-100, 0, 0>, <100, 0,0>, 0.3 pigment {Blue} } cylinder{ <0,-100,0>, <0,100,0>, 0.3 pigment {Green} } cylinder{ <0,0,-100>, <0,0,100>, 0.3 pigment {Red} } } union{ object{trilhos} object{trilhos translate <0, -15, 0>} } #declare gerador = seed(156987); union { object {locomotiva} //#declare n = 5+ 5*rand(gerador); #declare n = 5; #declare i = 0; #while (i < n) object{vagao translate <12+i*12, 0, 0>} #declare i = i + 1; #end //translate <-50+clock*100, 0, 0> #switch (clock) #range (0, 0.3) translate <-clock*clock*1600, 0, 0> #break #range (0.3, 0.7) rotate <0, 0, 180> translate <-250+clock*500, -15, 0> #break #range (0.7, 1) translate <1600*(1-clock)*(1-clock), 0, 0> #break #end }