//Caixa de Surpresas // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_color = texture{ pigment{ color rgb < 2.00, 0.40, 0.20 > } finish{ diffuse 0.9 ambient 0.1 } } // ====================================================================== // DESCRICAO DA CENA #include "eixos.inc" //Cria arvore recursivamente #macro arvore (nivel, tam, raio) #local tronco = cylinder{ < 0, 0, 0 >, < 0, 0, 6*tam >, raio texture{ tx_fosca } } #local dinheiro = box{ < 0,0,0 >, < tam*2.5,tam*2.5,0 > texture { tx_color } } #if (nivel=1) union{ object{tronco} object {dinheiro translate < 0, 0, 6*tam >} } #else union{ object{tronco} object{arvore(nivel-1, 0.5*tam, 0.5*raio) rotate 45*y translate< 0,0, tam*4 > } object{arvore(nivel-1, 0.5*tam, 0.5*raio) rotate -45*y translate< 0,0, tam*4 > } } #end #end object {eixos(3.00)} arvore (5, 1, 0.3) #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 4.00 >; #declare raio_cena = 7.0; #declare dir_camera = < 10.00, 17.00, 10.00 >; #declare dist_camera = 20.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)