//Rafael Henrique Castanheira de Souza, ra017134 //laboratorio : Algoritmos dao em arvores // ====================================================================== #include "textures.inc" #include "colors.inc" // The include files contain #include "stones.inc" // pre-defined scene elements #include "metals.inc" #include "woods.inc" #include "finish.inc" #include "shapes.inc" #include "skies.inc" #include "chars.inc" #include "stars.inc" // CÂMERA camera { location < 40.00, 20.00, 100.00 > // Posição do observador. right -0.75*x // Largura RELATIVA da imagem. up 1.00*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 0.00, 2.00, 85.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, -40.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.80, 0.80, 1.00> } #declare preto = texture { pigment { color rgb < 0.00, 0.00, 0.00 > } finish { diffuse 0.8 specular 0.2 roughness 0.015 ambient 0.4 } } #declare verde = texture { pigment { color rgb < 0.20, 0.80, 0.20 > } finish { diffuse 0.5 specular 0.0 roughness 0.05 ambient 0.1 } } #declare azul = texture { pigment { color rgb < 0.70, 0.70, 1.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.05 ambient 0.1 } } #declare branco = texture { pigment { color rgb < 1.00, 1.00, 1.00 > } finish { diffuse 0.7 specular 0.3 roughness 0.00005 ambient 0.1 } } #declare amarelo = texture { pigment { color rgb < 1.0,1.00, 0.00 > } finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.1 } } #declare fundo = plane{<0,0,1>, 0 texture{ pigment {granite scale <16,16,16> } finish {ambient 0.1 diffuse 0.9 } //scale 0.5 } } /*sky_sphere{ pigment {color rgb <0.7,0.7,1.0>} scale 2 translate -1 }*/ sky_sphere{S_Cloud4} #declare apontador = union{ cylinder{ <0.00,0.00,0.00>, <0.00,0.00,2.00>, 0.25 texture {Brass_Metal} } cone{ <0.00,0.00,2.00>,0.40, <0.00,0.00,2.50>,0.00 texture {amarelo} } } #declare folha = sphere { <0.00,0.00,0.00>, 1.00 texture {Red_Marble} //texture{Chrome_Metal} //texture{New_Brass} } #declare nodo = union{ object{folha} object{apontador rotate 180*y rotate 80*x } object{apontador rotate 180*y rotate -80*x } object{apontador rotate 180*y rotate 80*y } object{apontador rotate 180*y rotate -80*y } } #declare deltay = (2.50*0.984);//2.50 * cos teta #declare deltaz = (2.50*0.173 );//2.50 * sen teta #macro arvore(altura,posx, posy,posz) #if (altura = 1) object{folha translate} #else union{ object{nodo translate} arvore(altura-1,posx,posy-deltay,posz-deltaz-1) arvore(altura-1,posx,posy+deltay,posz-deltaz-1) arvore(altura-1,posx-deltay,posy,posz-deltaz-1) arvore(altura-1,posx+deltay,posy,posz-deltaz-1) } #end #end union{ object {fundo} arvore(9,0.00,0.00,100.00) }