// 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 < 1.0, 1.0, 1.0 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.50, 0.50, 0.50 > } finish{ diffuse 0.8 ambient 0.1 specular 5.8 roughness 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.1 } } // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #declare tronco = cylinder{ < 0, 0, -2 >, < 0, 0, +2 >, 1.0 texture { pigment {color rgb <0.64, 0.16, 0.16> }} } #macro base(n) #declare c1 = cylinder{ < 0, -n*1.5, 0 >, < 0, n*1.5, 0 >, n/4 texture { pigment {color rgb <0.74, 0.26, 0.26> }} } #declare c2 = cylinder{ < 0, 0, -n >, < 0, 0, n >, n/4 } #declare box1 = box{ < -0.4*n, -0.2*n , -0.80*n >, < 0.4*n, 0.2*n, 0.80*n > texture{ pigment { color rgb <0,1,0> } } } union { object { c1 translate <0,0,n> } object { c2 } object { box1 translate <0, -n*1.5, n> } object { box1 translate <0, n*1.5, n> } } #end #macro arvore(n) #if (n=0) object{ base(0.0001) } #else union { object { base(n) translate <0, 0, 2> } object { arvore(n-1) translate <0, 0, 3> } object { arvore(n-1) translate <0, -n, 2> } object { arvore(n-1) translate <0, n, 2> } } #end #end #declare caixa = box{ < -2.00, +2.00, -1.00 >, < +2.00, -2.00, +1.00 > texture {tx_vidro} } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #include "eixos.inc" // Aqui está a cena, finalmente: union{ object{ eixos(3.00) } object{ chao translate < 0,0,-5 > texture{ pigment { color rgb <0,1,0> } } } object { tronco } object { arvore(2) } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 15.0; #declare dir_camera = < 34.00, 10.00, 14.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)