// MC930 - Laboratorio 9 // Douglas Gardim RA: 008506 // ====================================================================== // CÂMERA camera { location < 110.00, 80.00, 200.00 > // Posição do observador. //location < 0.00, 80.00, 0.00 > // Posição do observador. right -1.00*x // Largura RELATIVA da imagem. up 0.75*y // Altura RELATIVA da imagem. sky y // Qual direção é "para cima"? look_at < -10.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 * < +15.0, +5.0, +5.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, +30.0, +50.0 > // Posição da lâmpada. color rgb 1.2 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA background{ color rgb < 0.75, 0.80, 0.85 > } #declare textura1 = texture { pigment {color rgb <0.3,0.3,0.1>} finish { ambient 0.1 diffuse 0.5 reflection 0.1 specular 0.90 roughness 0.005 } }; #declare textura2 = texture { pigment {color rgb <0,0.9,0>} finish { ambient 0.1 diffuse 0.5 reflection 0.1 specular 0.90 roughness 0.005 } }; #declare textura3 = texture { pigment {color rgb <0.5,0.5,0.5>} finish { ambient 0.2 diffuse 0.8 reflection 0.2 specular 0.90 roughness 0.005 } }; #declare MAX_SIZE = 20; #declare MAX_SIZE_MEDIA = 50; #macro Barra(atual, total, val1, val2) union { cylinder { <0,0,0>,<0,0.1+val1*MAX_SIZE,0>,4 texture {textura1} } cylinder { <0,0.1+val1*MAX_SIZE,0>,<0,0.2+val1*MAX_SIZE+val2*MAX_SIZE,0>,2 texture {textura2} } translate <45,10,0> rotate (-160/total * atual)*y translate <0,0,15> } #end #macro BarraMedia(val1, val2) union { cylinder { <0,0,0>,<0,0.1 + val1*MAX_SIZE_MEDIA,0>,18 texture {textura1} } cylinder { <0,val1*MAX_SIZE_MEDIA,0>,<0,0.1+val1*MAX_SIZE_MEDIA+val2*MAX_SIZE_MEDIA,0>,9 texture {textura2} } translate <0,10,20> } #end // Aqui está a cena, finalmente: plane {y, 0 texture { pigment{checker <0.2,0.2,0.2>,<0.3,0.3,0.3>} finish {ambient 0.2 diffuse 0.8 reflection 0.05} scale 30.0 } } union { union { box {<-90,0,-10>, <90,90,0>} box {<-90,0,0>, <90,10,90>} texture {textura3} } #include "dados.inc" }