// ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #macro arvore (n,alfa,beta) #if (n = 0) object { box{ <-0.1,0,0>, <0.1,0,0.4> texture{ pigment { color rgb <0.2,1,0.2>}}} } #else union{ object{ cylinder{ <0,0,0>, <0,0,0.4*n>, 0.05*n texture{ pigment{ color rgb <1,0.5,0>}} } } object{ arvore(n-1,0.95*alfa,0.9*beta) rotate <0,-alfa,pow(-1,n)*beta> translate <-0.02*n,0,0.4*n> } object{ arvore(n-1,0.95*alfa,0.9*beta) rotate <0,0,0> translate <0,0,0.4*n> } object{ arvore(n-1,0.95*alfa,0.9*beta) rotate <0,alfa,-pow(-1,n)*beta> translate <0.02*n,0,0.4*n> } } #end #end #include "eixos.inc" // Aqui está a cena, finalmente: union{ object{ eixos(3.00) } object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } object{ arvore (4,30,15) translate <5,5,0>} object{ arvore (6,30,12) translate <-10,-1,-2>} object{ arvore (8,35,0) translate <-1,-9,-4>} } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 14.0; #declare dir_camera = < 4, 4, 2 >; #declare dist_camera = 30.0; #declare intens_luz = 1; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)