// 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_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_fosca = texture{ pigment{ color rgb < 0.50, 0.50, 0.60 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_tronco = texture{ pigment{ color rgb < 92, 51, 23 >/255 } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_dinheiro = texture{ pigment{ color rgb < 10, 110, 10 >/255 } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 0.80, 0.80, 0.85 > } finish{ diffuse 0.2 reflection 0.1*< 0.80, 0.80, 0.85 > 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.72, 0.20 >, color rgb < 0.2, 0.2, 0.20 > } finish{ diffuse 0.9 ambient 0.1 } scale 0.5 } #declare tx_biscoito = texture{ pigment{ color rgb < 0.50, 0.25, 0.05 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_basezinha= texture{ pigment{ color rgb < 0.70, 0.40, 0.40 > } finish{ diffuse 0.9 ambient 0.1 } } // ====================================================================== // DESCRIÇÃO DA CENA #declare raio_mastro = 0.2; // Partes da cena: #declare chao = box{ <-15,-15,-1>, <+15,+15,0> } #macro arvore (n, angulo, inicio,completo) #local reducao=1.8; #if (mod(n,2)=1) #local angulo_eixo = angulo*x; #else #local angulo_eixo = angulo*y; #end #local altura = 7/pow(reducao,(4-n)); #local raiomaior = 1/pow(reducao,(5-n)); #local raiomenor = 2/(3*pow(reducao,(5-n))); #local novoinicio = inicio + vrotate(<0,0,altura/2>,angulo_eixo); #if(completo=false) #local altura=altura/2; #end #if (n=0) sphere{<0,0,0>, 0} #else union{ cone { <0,0,0>, raiomaior <0,0,altura>, raiomenor rotate angulo_eixo translate inicio } box { <0,-0.25,-1>, <0,0.25,0> #if(mod(n,2)=1) rotate 90*z #end translate inicio+vrotate(<0,0,altura>,angulo_eixo) texture{tx_dinheiro} } object{ arvore(n-1, -45, novoinicio, true) } object{ arvore(n-1, 45, novoinicio, true) } texture{tx_tronco} } #end #end #include "eixos.inc" // Aqui está a cena, finalmente: union{ //object{ eixos(5.00) } object{ chao texture{tx_espelho} } object{ arvore(4,0,<0,0,0>,false) } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 2.00 >; #declare raio_cena = 9.0; #declare dir_camera = < 6.00, 2.00, 4.00 >; #declare dist_camera = 26.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)