// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2010-03-04 15:44:01 by stolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_tronco = texture{ pigment{ color rgb < 0.65, 0.16, 0.16 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_folha = texture{ pigment{ color rgb < 0.13, 0.55, 0.13 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0, 0, 0 >, color rgb < 1, 1, 1 > filter 0.9} finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #declare altura_inicial = 40; #declare profundidade = 4; #declare chao = box{ <-50,-50,-1>, <+50,+50,0> texture{ tx_xadrez } } #declare tronco = cylinder{ <0, 0, 0>, <0, 0, altura_inicial>, 4 texture { tx_tronco } } #declare folha = box{ <0, 0, 0>, <20, 60, 5> texture { tx_folha } } #macro arvore (n, c, d) #if(n = 0) // Folha union { object{ folha } } #else // Tronco #local novo_c = c * 1.3; #local novo_d = d * 1.1; union { object{ tronco texture{ pigment{ color rgb < 0.65 * c, 0.16 * c, 0.16 * c > } finish{ diffuse 0.9 * d ambient 0.1 } } } object{ arvore(n-1, novo_c, novo_d) rotate <30, 30, 0> scale 0.5 translate <0, 0, altura_inicial * 7/8> } object{ arvore(n-1, novo_c, novo_d) rotate <-30, -30, 0> scale 0.5 translate <0, 0, altura_inicial * 7/8> } object{ arvore(n-1, novo_c, novo_d) rotate <60, 60, 0> scale 0.5 translate <0, 0, altura_inicial * 5/8> } object{ arvore(n-1, novo_c, novo_d) rotate <-60, -60, 0> scale 0.5 translate <0, 0, altura_inicial * 5/8> } object{ arvore(n-1, novo_c, novo_d) rotate <90, 90, 0> scale 0.5 translate <0, 0, altura_inicial * 4/8> } object{ arvore(n-1, novo_c, novo_d) rotate <-90, -90, 0> scale 0.5 translate <0, 0, altura_inicial * 4/8> } } #end #end #include "eixos.inc" // Aqui está a cena, finalmente: union{ object{ chao } object{ arvore(profundidade, 1, 1) } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 110.0; #declare dir_camera = < 1.00, 1.00, 1.00 >; #declare dist_camera = 120.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)