// Includes #include "retalho.inc" //#include "nuvens.inc" // Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2009-03-09 18:44:03 by stolfi // ====================================================================== // CÂMERA camera{ location < 10.00, 0.00, 0.0 > // Posição do observador. right -0.75*x // Largura RELATIVA da imagem. up 0.60*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 0.00, 0.00, 1.00 > // Para onde a câmera está apontando. } // Nota: os parâmetros "right" e "up" devem ter a mesma proporção // que os parâmetros ${WIDTH} e ${HEIGHT} no Makefile. // ====================================================================== // FONTES DE LUZ light_source{ 10 * < +50.0, +30.0, +50.0 > // Posição da lâmpada. color rgb 1.0 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source{ 10 * < +50.0, -10.0, +10.0 > // Posição da lâmpada. color rgb 0.5 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // EIXOS DE COORDENADAS #macro eixo(ponta,cor,nome) union{ sphere{ <0,0,0>, 0.02 } cylinder{ <0,0,0>, 0.91*ponta, 0.02 } cone{ 0.90*ponta, 0.06, ponta, 0.00 } texture{ pigment{ color rgb cor } finish{ ambient 0.5 diffuse 0.5 } } } #end #macro eixos(tamanho) union{ object{ eixo( , <1.0,0.2,0.2>, "X") } object{ eixo( <0,tamanho,0>, <0.0,0.8,0.0>, "Y") } object{ eixo( <0,0,tamanho>, <0.3,0.3,1.0>, "Z") } } #end // ====================================================================== // 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.40, 0.40, 0.40 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_carro = texture{ pigment{ color rgb < 0.40, 0.40, 0.40 > } finish{ diffuse 0.1 ambient 0.1 reflection 0.5 * <1,1,1> } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.90, 0.70 > } finish{ diffuse 0.1 reflection 0.8*< 1.00, 0.90, 0.70 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.97, 0.98, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_fosca1 = texture{ pigment{ color rgb < 1.00, 0.30, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca2 = texture{ pigment{ color rgb < 1.00, 0.50, 0.50 > } finish{ diffuse 0.9 ambient 0.1 } } // ====================================================================== // DESCRIÇÃO DA CENA //#declare raio = 2.000; // Partes da cena: #declare P1 = <0,0,0>; #declare P2 = <0,1,0>; #declare P3 = <0,1.5,0>; //----------------------------------------------------------- #macro mamao() blob{ sphere { P1, 0.8, 2 texture {pigment{color rgb <1.0, 0.3, 0.0>}} } sphere { P2, 0.5, 1 texture {pigment{color rgb <1.0, 0.6, 0.10>}} } sphere { P3, 0.18, -1 } cylinder{P1, P2, 0.5, 2 texture {pigment{color rgb <1.0, 0.6, 0.10>}}} threshold 0.5 } #end #macro dedo3( r3, c3, alfa3) blob{ sphere { P1, r3 + 0.1 ,1 } cylinder{P1, P1 + y*c3 , r3, 1 } threshold 0.5 texture {tx_fosca1} } #end #macro dedo2(r2, c2, alfa2, r3, c3, alfa3) union{ blob{ sphere { P1, r2 + 0.1 ,1 } cylinder{P1, P1 + y*c2 , r2, 1 } sphere { P1 + y*c2, r2 + 0.1,1 } threshold 0.5 texture {tx_fosca1} } object {dedo3(r3, c3, alfa3) rotate x * alfa3 translate y * P1 + y * c2 } } #end #macro dedo(r1, c1, r2, c2, alfa2, r3, c3, alfa3) union { blob{ sphere { P1, r1 + 0.1 ,1 } cylinder{P1, P1 + y*c1 , r1, 1 } sphere { P1 + y*c1, r1 + 0.1,1 } threshold 0.5 texture {tx_fosca1} } object {dedo2(r2, c2, alfa2, r3, c3, alfa3) rotate x * alfa2 translate y * P1 + y * c1 } } #end #macro dedao(r1, c1, r3, c3, alfa3) union { blob{ sphere { P1, r1 + 0.1 ,1 } cylinder{P1, P1 + y*c1 , r1, 1 } sphere { P1 + y*c1, r1 + 0.1,1 } threshold 0.5 texture {tx_fosca1} } object {dedo3(r3, c3, alfa3) rotate x*alfa3 translate y * P1 + y * c1 } } #end #macro mao(r1_mind, c1_mind, r2_mind, c2_mind, alfa2_mind, r3_mind, c3_mind, alfa3_mind, r1_ant, c1_ant, r2_ant, c2_ant, alfa2_ant, r3_ant, c3_ant, alfa3_ant, r1_cent, c1_cent, r2_cent, c2_cent, alfa2_cent, r3_cent, c3_cent, alfa3_cent, r1_ind, c1_ind, r2_ind, c2_ind, alfa2_ind, r3_ind, c3_ind, alfa3_ind, r1_pol, c1_pol, r3_pol, c3_pol, alfa3_pol) union { blob{ cylinder{<0,0,0>, <0,1,0>, 0.3, 2} cylinder{<0.15, 0, 0>, <0.3,1,0>, 0.3, 2} cylinder{<0.35, 0, 0>, <0.6,1,0>, 0.3, 2} cylinder{<0.5, 0, 0>, <0.9,1,0>, 0.3, 2} cylinder{<0.65, 0, 0>, <1.2,0.7,0>, 0.3, 2} threshold 0.5 texture {tx_fosca1} } object {dedo (r1_mind, c1_mind, r2_mind, c2_mind, alfa2_mind, r3_mind, c3_mind, alfa3_mind) translate y*1 } object {dedo (r1_ant, c1_ant, r2_ant, c2_ant, alfa2_ant, r3_ant, c3_ant, alfa3_ant) translate y*1 + x*0.3 } object {dedo (r1_cent, c1_cent, r2_cent, c2_cent, alfa2_cent, r3_cent, c3_cent, alfa3_cent) translate y*1 + x*0.6 } object {dedo (r1_ind, c1_ind, r2_ind, c2_ind, alfa2_ind, r3_ind, c3_ind, alfa3_ind) translate y*1 + x*0.9 } object {dedao (r1_pol, c1_pol, r3_pol, c3_pol, alfa3_pol) translate y*0.7 + x*1.2 } } #end #macro anao() blob { sphere { P1, 3 ,1 texture {tx_fosca2}} sphere { <0, 1.9, 0.5>, 0.5 ,1 texture {tx_fosca2}} sphere { <0, -1.9, 0.5>, 0.5 ,1 texture {tx_fosca2}} sphere { <1.8, 0, 0>, 0.3 ,1 texture {tx_fosca2}} sphere { <1.3, -0.5, 0.5>, 0.3 ,1 texture {pigment{color rgb <0, 0, 0>}}} sphere { <1.3, 0.5, 0.5>, 0.3 ,1 texture {pigment{color rgb <0, 0, 0>}}} cylinder{<1.3,-0.3,-0.6>, <1.3,0.3,-0.6>, 0.3, 2 texture {tx_fosca2}} threshold 0.5 } #end #macro mamao_ou_anao(F) blob{ sphere { P1, 0.8, F*2 texture {pigment{color rgb <1.0, 0.3, 0.0>}} } sphere { P2, 0.5, F*1 texture {pigment{color rgb <1.0, 0.6, 0.10>}} } sphere { P3, 0.18, F*-1 } cylinder{P1, P2, 0.5, F*2 texture {pigment{color rgb <1.0, 0.6, 0.10>}}} threshold 0.5 sphere { P1, 3 ,1-F texture {tx_fosca2}} sphere { <0, 1.9, 0.5>, 0.5 ,1-F texture {tx_fosca2}} sphere { <0, -1.9, 0.5>, 0.5 ,1-F texture {tx_fosca2}} sphere { <1.8, 0, 0>, 0.3 ,1-F texture {tx_fosca2}} sphere { <1.3, -0.5, 0.5>, 0.3 ,1-F texture {pigment{color rgb <0, 0, 0>}}} sphere { <1.3, 0.5, 0.5>, 0.3 ,1-F texture {pigment{color rgb <0, 0, 0>}}} cylinder{<1.3,-0.3,-0.6>, <1.3,0.3,-0.6>, 0.3, 2-F texture {tx_fosca2}} } #end //______________ //Gerando a Cena union { object { eixos (5) } //object {mamao()} //object {mao(0.3, 0.5, 0.25, 0.4, 30, 0.25,0.4,1, 0.3, 0.6, 0.25, 0.5, 1, 0.25,0.5,1, 0.3, 0.8, 0.25, 0.5, 20, 0.25,0.5,1, 0.3, 0.7, 0.25, 0.5, 1, 0.25,0.5,1, 0.3, 0.7, 0.25, 0.5, 50 )} //object {anao()} mamao_ou_anao((1+cos(2*pi*clock))/2) }