// CORES E TEXTURAS background{ color rgb < 0.2, 0.6, 0.8 > } #declare tx_grama = texture{ pigment{ color rgb < 0.14, 0.56, 0.14 >} finish{ diffuse 0.7 ambient 0.5 } } #declare tx_arvore = texture{ pigment{ color rgb < 0.64, 0.16, 0.16 > } finish{ diffuse 0.2 ambient 0.1 } } #declare tx_prata = texture{ pigment{ color rgb < 0.3, 0.3, 0.3 > } finish{ diffuse 0.2 reflection 0.6 brilliance 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02} } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.5, 0.44, 0.98 >, color rgb < 0.00, 0.86, 0.29 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } //MACROS #macro galhada(n,tam,rot) #if(n=0) object{galho scale 1/tam //rotate rot //translate <0,0,0.4>*tam } #else union{ object{galho scale 1/tam } object{galhada(n-1,tam+1,rot+10) rotate translate <0,0,1>*(1/tam) } object{galhada(n-1,tam+1,-(rot+10)) rotate rot translate <0,0,1>*(1/tam) } } #end #end // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #declare raio = 0.2; #declare tronco = cylinder{ <0,0,0>, <0,0,3>, 4*raio texture{tx_arvore} } #declare galho = cylinder{ <0,0,0>, <0,0,1>, 2*raio texture{tx_arvore} } #declare raiz = cone{ <0,0,0>, 5*raio,<0,0,2>, 0 texture{tx_arvore} } #declare topo = cone{ <0,0,0>, 4*raio,<0,0,0.8>,1.2*raio texture{tx_arvore} } #declare grana = box{ <0,0,0>,<0.05,0.05,0.05> texture{tx_grama} } #include "eixos.inc" object{eixos(3.00)} union{ object{raiz} object{tronco} object{topo translate <0,0,3> } object{galhada(4,<1,1,1>,30) rotate <10,10,30> translate <0,0,3> } object{galhada(4,<1,1,1>,30) rotate <20,20,50> translate <0.5,0,3> } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 5; #declare dir_camera = < -3,3,3 >; #declare dist_camera = 30; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)