// LAB 03 - O Templo da Computação // ====================================================================== // CÂMERA camera { location < -15.00, -10.00, 6.00 > // Posição do observador. right -1.00*x // Largura RELATIVA da imagem. up 0.50*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 60.00, 25.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. } light_source { 10 *< 10.0, 30.0, 5.00 > // Posição da lâmpada. color rgb 5 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { 10 *< -30.0, 30.0, 80.00 > // Posição da lâmpada. color rgb 1 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA background{ color rgb < 0.8, 0.85, 0.9 > } #include "colors.inc" #declare tinta_Azul = texture { pigment { color rgb < 0.30, 0.00, 1.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_AzulClaro = texture { pigment { color rgb < 0.00, 1.00, 1.50 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_Verde = texture { pigment { color rgb < 0.00, 1.00, 0.50 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_VerdeClaro = texture { pigment { color rgb < 0.00, 1.50, 1.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_Vermelha = texture { pigment { color rgb < 1.00, 0.30, 0.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } //#declare sala = // box { // < 0.00, 0.00, 0.00 >, // < 3.00, 3.00, 3.00 > // texture { tinta_Azul } // } //#declare buraco_sala = // box { // < 0.50, 0.50, 0.50 >, // < 2.50, 2.50, 2.50 > // texture { tinta_AzulClaro } // } //#declare janela = // box { // < 0.75, 0.75, 0.50 >, // < 2.25, 2.25, 3.50 > // texture { tinta_AzulClaro } // } //difference { // difference { // object { sala } // object { buraco_sala } // } // object { janela } //} #declare j=0; #declare g = seed(12346); #declare cabine = difference { box { <0,0,-0.1>, <2.5,3,4> } box { <-1,-1,2.5>, <1.1,4,3.5> } texture {tinta_VerdeClaro} } #declare engate = cylinder { <0,0,0>, <1.5,0,0>, 0.2 pigment {Pink} } #declare corpo_locomotiva = difference { box { <0,0,0>, <13.5,3,3> } box { <0,-1,0>, <10,4,10> rotate <0,-60,0> } texture {tinta_VerdeClaro } } #declare chamine = difference { cylinder { <0,0,-0.1>, <0,0,5>, 1.5 } cylinder { <0,0,-0.2>, <0,0,5.1>, 1 } texture {tinta_VerdeClaro } } #declare roda = cylinder { <0,0,0>, <0,0.3,0>, 1.25 texture {tinta_Vermelha} } #declare eixo = union { object {roda} object {roda translate <0,2.7,0>} cylinder { <0,0.15,0>, <0,2.85,0>, 0.2 pigment {Black} } } #declare locomotiva = union{ object {corpo_locomotiva} object {cabine translate <3,0,3>} object {chamine translate <8,1.5,3>} object {chamine scale <1,1,1.2> translate <12,1.5,3>} #declare i = 1; #while (i < 5) object {eixo translate <0.5 + 3*i,0,-1.25>} #declare i = i + 1; #end } #declare vagao = union { difference { box { <0.5,0,0>, <11.5,3,5> texture {tinta_VerdeClaro} } box { <0.7,0.2,0.2>, <11.3,2.8,4.8> texture {tinta_VerdeClaro} } #declare i = 1; #while(i<4) text {ttf "verdanab.ttf" "$" 5,0 rotate <90,0,0> scale <2,5,2> translate <0.25 + 2.5 *i,2,2> texture {tinta_VerdeClaro} } text {ttf "verdanab.ttf" "$" 3,0 rotate <-90,0,0> scale <2,5,2> translate <0.25 + 2.5 *i,1,3> texture {tinta_VerdeClaro} } #declare i = i + 1; #end } object {engate translate <-0.9,1.5,0.5>} #declare i = 0; #while (i < 4) object {eixo translate <0.5 + 1.25 + 3*i,0,-1.25> } #declare i = i + 1; #end translate <0.9,0,0> //correçao pra nao ter que refazer as coordenadas em x } #declare trem = union { object {locomotiva} #declare nvag = 5 + 3 * rand(g); #declare i = 0; #while (i < nvag) object {vagao translate <13.49 + i * 12.29 ,0,0>} #declare i = i + 1; #end } trem