#include "colors.inc" #include "stones.inc" #include "textures.inc" // Trabalho 8 de MC930 // ====================================================================== // CÂMERA camera { location < 40.00, 16.00, 30.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, 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 > } ////////////Declaração das cores #declare ciano_espelhado = texture { pigment { Blue filter 0.5} finish { ambient 0.1 diffuse 0.35 reflection 0.25 specular 1 roughness 0.001 } } #macro tronco(raizx, raizy, raizz, filho1, filho2, filho3, filho4) union { sphere { , 1 texture {ciano_espelhado} } #if (filho1) cylinder { , , 0.3 texture { pigment { color Black}} } sphere { , 1 texture {ciano_espelhado} } #end #if (filho2) cylinder { , , 0.3 texture { pigment { color Black}} } sphere { , 1 texture {ciano_espelhado} } #end #if (filho3) cylinder { , , 0.3 texture { pigment { color Black}} } sphere { , 1 texture {ciano_espelhado} } #end #if (filho4) cylinder { , , 0.3 texture { pigment { color Black}} } sphere { , 1 texture {ciano_espelhado} } #end } #end #declare G=seed(69); #macro arvore(pontox,pontoy,pontoz,contador,maximo) #local a=rand(G); #local b=rand(G); #local c=rand(G); #local d=rand(G); #if (contador < maximo) #if (a > 0.75) #local filho1 = 1; arvore(pontox+4+contador,pontoy+contador,pontoz-3,contador+1,maximo) #else #local filho1 = 0; #end #if (b > 0.75) #local filho2 = 1; arvore(pontox-4+contador,pontoy+contador,pontoz-3,contador+1,maximo) #else #local filho2 = 0; #end #if (c > 0.75) #local filho3 = 1; arvore(pontox+contador,pontoy+4+contador,pontoz-3,contador+1,maximo) #else #local filho3 = 0; #end #if (d > 0.75) #local filho4 = 1; arvore(pontox+contador,pontoy-4+contador,pontoz-3,contador+1,maximo) #else #local filho4 = 0; #end #if (filho1 | filho2 | filho3 | filho4) tronco(pontox,pontoy,pontoz,filho1,filho2,filho3,filho4) #end #end #end /////////// A cena segue abaixo: arvore(0,0,20,0,50)