#include "eixos.inc" #include "camlight.inc" // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_galho = pigment { wood turbulence 0.05 scale <0.2, 0.2, 1> color_map { [0.1 rgb <0.42, 0.26, 0.15>] [0.9 rgb <0.52, 0.37, 0.26>] } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_verde = texture{ pigment{ color rgb <0,1,0>} finish{ diffuse 0.9 ambient 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 specular 0.25 roughness 0.005 } } #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 #macro arvore(yi, zi, yf, zf, n, raio, tamanho) #if (n = 0) union{ box{ <0,yf-0.05,zf>, <0,yf+0.05,zf+0.2> texture{ tx_verde } } cylinder{ < 0, yi, zi >, < 0, yf, zf >, 0.2*raio texture{ tx_galho } } } #else union { cylinder{ < 0, yi, zi >, < 0, yf, zf >, 0.2*raio texture{ tx_galho } } object{ arvore(yf, zf, yf-tamanho*(0.866), zf+tamanho*(0.5), n-1,raio/2,tamanho/2) } object{ arvore(yf, zf, yf, zf+tamanho*(1), n-1,raio/2,tamanho/2) } object{ arvore(yf, zf, yf+tamanho*(0.866), zf+tamanho*(0.5), n-1,raio/2,tamanho/2) } } #end #end // Aqui está a cena, finalmente: object{arvore(0,0,0,2,3,1,1)} #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 6.0; #declare dir_camera = < 7.00, 1.00, 7.00 >; #declare dist_camera = 16.0; #declare intens_luz = 3.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)