// 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 < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > 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_verde = texture{ pigment{ color rgb < 0, 1, 0 > } finish{ diffuse 0.9 ambient 0.1 } } #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 #declare raio_tronco = 0.300; #declare cedula = box{ <-0.1,-0.2,0>, <+0.1,+0.2,0> } // Partes da arvore #declare tronco = cylinder { <0,0,0>, <0,0,5>, raio_tronco texture{ tx_fosca } } #declare bico_tronco = cone{ <0, 0, 5>, raio_tronco, <0, 0, 6>, 0.1 * raio_tronco texture{ tx_fosca } } // ====================================================================== // MACRO FOR THE TREE #macro cedulas() union { object{ cedula rotate <0, 0, 0> translate <0, 0.5, 2.4> texture{ tx_verde } } object{ cedula translate <0, 0.5, 2.4> rotate <0, 0, -90> texture{ tx_verde } } object{ cedula translate <0, 0.5, 2.4> rotate <0, 0, 90> texture{ tx_verde } } object{ cedula translate <0, 0.5, 2.4> rotate <0, 0, -180> texture{ tx_verde } } } #end #macro arvore(numero_galhos/*, raio_tronco, altura_tronco*/) #if(numero_galhos = 0) // Only one branch union{ object{ tronco texture{ tx_fosca } } object{ bico_tronco texture{ tx_fosca } } object{ cedula rotate <0, 0, 0> translate <0, 0.5,1> texture{ tx_verde } } object{ cedula rotate <0, 0, 0> translate <0, 0.5,2> texture{ tx_verde } } object{ cedula rotate <0, 0, 0> translate <0,-0.5,1> texture{ tx_verde } } object{ cedula rotate <0, 0, 0> translate <0,-0.5,2> texture{ tx_verde } } } #else union{ // Tronco principal object{ tronco texture{ tx_fosca } } object{ bico_tronco texture{ tx_fosca } } // Galhos de baixo object { arvore(numero_galhos - 1) rotate <-45, 0, 0> scale 0.7 translate <0, 0, 1.5>} object { arvore(numero_galhos - 1) rotate < 45, 0, 0> scale 0.7 translate <0, 0, 1.5>} object { arvore(numero_galhos - 1) rotate < 0, -45, 0> scale 0.7 translate <0, 0, 1.5>} object { arvore(numero_galhos - 1) rotate < 0, +45, 0> scale 0.7 translate <0, 0, 1.5>} /* object{ cedula rotate <0, 0, 0> translate <0, 0.5, 2.4> texture{ tx_verde } } object{ cedula translate <0, 0.5, 2.4> rotate <0, 0, -90> texture{ tx_verde } } object{ cedula translate <0, 0.5, 2.4> rotate <0, 0, 90> texture{ tx_verde } } object{ cedula translate <0, 0.5, 2.4> rotate <0, 0, -180> texture{ tx_verde } }*/ object {cedulas()} object {cedulas() translate <0, 0, 0.5>} object {cedulas() translate <0, 0, 1>} object {cedulas() translate <0, 0, 2>} object {cedulas() translate <0, 0, 2.5>} object { arvore(numero_galhos - 1) rotate <-45, 0, 0> scale <0.7, 0.7, 0.7> translate <0, 0, 3.5>} object { arvore(numero_galhos - 1) rotate < 45, 0, 0> scale <0.7, 0.7, 0.7> translate <0, 0, 3.5>} object { arvore(numero_galhos - 1) rotate < 0, -45, 0> scale <0.7, 0.7, 0.7> translate <0, 0, 3.5>} object { arvore(numero_galhos - 1) rotate < 0, +45, 0> scale <0.7, 0.7, 0.7> translate <0, 0, 3.5>} /*object { arvore(numero_galhos - 1) rotate <45, 0, 90> scale <0.7, 0.7, 0.7> translate <0, 0, 0.5>} object { arvore(numero_galhos - 1) rotate <45, 0, -90> scale <0.7, 0.7, 0.7> translate <0, 0, 0.5>} object { arvore(numero_galhos - 1) rotate <45, 0, 180> scale <0.7, 0.7, 0.7> translate <0, 0, 0.5>} // Galohs de cima object { arvore(numero_galhos - 1) rotate <45, 0, 0> scale <0.7, 0.7, 0.7> translate <0, 0, 1.5>} object { arvore(numero_galhos - 1) rotate <45, 0, 90> scale <0.7, 0.7, 0.7> translate <0, 0, 1.5>} object { arvore(numero_galhos - 1) rotate <45, 0, -90> scale <0.7, 0.7, 0.7> translate <0, 0, 1.5>} object { arvore(numero_galhos - 1) rotate <45, 0, 180> scale <0.7, 0.7, 0.7> translate <0, 0, 1.5>}*/ } /*union{ (tronco) object { arvore(n - 1, 0.8 * r) ... } object { arvore(n - 1) ... } ... }*/ #end #end #include "eixos.inc" // Aqui está a cena, finalmente: union{ object{ eixos(5.00) } /* object{ cedula rotate <90, 0, -30> translate <0,2,0> texture{ tx_fosca } } union{ object{ tronco texture{ tx_fosca } } object{ bico_tronco texture{ tx_fosca } } }*/ object{ arvore(2) translate <0, 0, -2> /*scale <0.7, 0.7, 0.7>*/} /* object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } object{ surpresa_cilindro translate < 0.2,0.2,0 > texture{ tx_vidro } } object{ surpresa_bola translate < 0.5, 0.5, -0.4 > texture{ tx_plastico } } object{ surpresa_cone translate < 0, 0.5, 0 > texture{ tx_xadrez } } object{ surpresa_caixa translate < -0.5, 0, 0 > scale<1.3, 1.3, 1> texture{ tx_espelho } } // Caixa difference{ object{ caixa_quadrada texture{ tx_fosca } } object{ interior_caixa scale<0.95, 0.95, 1> translate < 0.1, 0.1, 0> texture{ tx_fosca } } } // Tampa difference{ object{ tampa_quadrada texture{ tx_vidro } } object{ interior_tampa scale<0.95, 0.95, 1> translate < 0.1, 0.1, 0> texture{ tx_vidro } } }*/ } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 6.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)