// André Luiz Gomide Papa - ra002793 // TP03 - 05/10/2004 // ====================================================================== // CÂMERA camera { location < 25.00, -30.00, 4.00 > // Posição do observador. right -1.00*x // Largura RELATIVA da imagem. up 0.75*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 0.00, 0.00, 0.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, +10.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 raio = 2.000; #declare tinta_A = texture { pigment { color rgb < 0.10, 0.80, 1.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_B = texture { pigment { color rgb < 1.00, 0.80, 0.10 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_C = texture { pigment { color rgb < 0.6, 0.6, 0.6 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_D = texture { pigment { color rgb < 0.5, 0.5, 0.5 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare base = box{ <0.00, 0.00, 0.00>, <2,6,2> texture{tinta_A} } #declare parte_cima = box{ <0,4,2>, <2,6,4> texture{tinta_B} } #declare telhado = box{ <-0.5,3.5,4>, <2.5,6.5,4.5> texture{tinta_A} } #declare chamine = cylinder{ <0,0,0>, <0,0,2>, 0.5 texture{tinta_B} } #declare roda = cylinder{ <0,0,0>, <0,0,0.5>, 0.5 texture{tinta_B} } #declare vagao = box{ <0.00,0.00,0.00>, <2,8,2> texture{tinta_A} } #declare trilho = box{ <0,-200,0>, <0.5,200,0.3> texture{tinta_C} } // Aqui está a cena, finalmente: object {base} object {parte_cima} object {telhado} object {chamine translate <1,0,2>} //colocando as rodas na locomotiva #declare j = 0; #while(j < 3) #declare i = 1; #while(i < 6) object {roda translate <0,i,j> rotate 90*y} #declare i = i + 2; #end #declare j = j + 2; #end #declare janelas = box{ <-1,0.2,0.8>, <3,0.8,1.4> texture{tinta_B} } // vagao completo #declare vagao_completo = union{ difference{ object {vagao translate <0,6.5,0>} #declare i = 7.7; #while(i < 13) object {janelas translate <0,i,0>} #declare i = i + 1.2; #end } #declare j = 0; #while(j < 3) #declare i = 7.5; #while(i < 14) object {roda translate <0,i,j> rotate 90*y} #declare i = i + 2; #end #declare j = j + 2; #end } // colocando 10 vagoes #declare n_vagoes = 0; #declare a = 0; #while(n_vagoes < 10) object {vagao_completo translate <0,a,0>} #declare a = a + 8.5; #declare n_vagoes = n_vagoes + 1; #end // colocando os trilhos object {trilho translate <2,-50,-0.7>} object {trilho translate <0,-50,-0.7>} plane {z,0 texture{ pigment{ checker <0.2,0.8,0.1>, <0.3,0.3,0.5>} finish{ambient 0.2 diffuse 0.5} scale 2 } translate <0,0,-0.8> }