// 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 <0, 0, -6> // Posição do observador. location <2.5, 0, 0.5> right -1.8*x // Largura RELATIVA da imagem. up 1.8*z // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 0,0,0 > // 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{ < 30, 0, 0> // Posição da lâmpada. color rgb 0.4*< 1.00, 1.00, 1.00 > // Intensidade e corda luz. shadowless } light_source{ < -30, 0, 0> // Posição da lâmpada. color rgb 0.4*< 1.00, 1.00, 1.00 > // Intensidade e corda luz. shadowless } light_source{ < 0, 30, 0> // Posição da lâmpada. color rgb 0.4*< 1.00, 1.00, 1.00 > // Intensidade e corda luz. shadowless } light_source{ < 0, -30, 0> // Posição da lâmpada. color rgb 0.4*< 1.00, 1.00, 1.00 > // Intensidade e corda luz. shadowless } light_source{ < 0, 0, 30> // Posição da lâmpada. color rgb 0.4*< 1.00, 1.00, 1.00 > // Intensidade e corda luz. shadowless } light_source{ < 0, 0, -30> // Posição da lâmpada. color rgb 0.4*< 1.00, 1.00, 1.00 > // Intensidade e corda luz. shadowless } // ====================================================================== // 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_branco = texture{ pigment{ color rgb 1 } finish{ diffuse 0.1 reflection 0.2 ambient 0.6 specular 0.1 roughness 0.005 } } #declare tx_plastico_preto = texture{ pigment{ color rgb 0 } finish{ diffuse 0.1 reflection 0.2 ambient 0.6 specular 0.1 roughness 0.005 } } */ #declare tx_verde = texture{ pigment{ color rgb < 0.1, 0.60, 0.08 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_laranja = texture{ pigment{ color rgb < 0.8, 0.60, 0.2 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_preto = texture{ pigment{ color rgb < 0, 0, 0 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_pele = texture{ pigment{ color rgb < 0.85, 0.7, 0.4 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_olho = texture{ pigment{ color rgb < 0, 0.7, 0.1 > } finish{ diffuse 1 reflection 1 ambient 1 specular 1 roughness 1 } //finish{ diffuse 0.9 ambient 0.1 } } #declare tx_boca = texture{ pigment{ color rgb < 0.7, 0.0, 0.1 > } finish{ diffuse 0.9 ambient 1 } //finish{ diffuse 0.9 ambient 0.1 } } #declare tx_nariz = texture{ pigment{ color rgb < 0, 0, 0> } finish{ diffuse 1 reflection 1 ambient 1 specular 1 roughness 1 } //finish{ diffuse 0.9 ambient 0.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 < 1, 1, 1 > filter 0.90 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_vidro_preto = texture{ pigment{ color rgb 0 filter 0.80 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } */ // ====================================================================== // DESCRIÇÃO DA CENA /* #declare osso = blob { sphere{<0, 0, 0>, 1, 1} cylinder {<0.2, 0, 0>, <2, 0, 0>, 0.9, 1} threshold 0.5 scale <1, 1, 0.8> texture{tx_pele} } #macro dedo_ponta() blob { sphere{<0, 0, 0>, 1, 1 scale <1.3, 1, 0.8>} threshold 0.5 texture{tx_pele} } #end #macro dedo_meio(ang) union { object{osso} object{dedo_ponta() rotate <0, -ang, 0> translate <2.2, 0, 0.1>} } #end #macro dedo(ang1, ang2) #end */ #macro sphere_torus(r1, r2, n, f, pos, rot, sca, tex) #declare i=0; #declare ang=(2*pi)/n; #while (i < n) sphere{, r2, f scale sca rotate rot translate pos texture{tex}} #declare i=i+1; #end #end #declare mamao = blob { sphere{<0,0,0>, 1.5, 1.4 texture{tx_verde}} sphere{<0,1,0>, 2, 0.7 scale <0.9, 1, 0.7> texture{tx_laranja}} cylinder{<0, 1.5, 0> <0,1.6,0>, 0.3, 1.2 scale <0.9, 1, 0.7> texture{tx_laranja}} sphere_torus(0.15, 0.3, 7, 2, <0, -0.9, 0>, <90, 0, 0>, <1, 1, 0.6>, tx_laranja) sphere{<0,-1.2,0>, 0.3, -1 texture{tx_laranja}} threshold 0.5 scale <1, 1, 0.9> } #declare anao = blob { sphere{<0, 0, 0>, 2, 1 texture{tx_pele}} sphere{<0.8, 0.4, 0.3>, 0.2, 5 texture{tx_olho}} sphere{<0.8, -0.4, 0.3>, 0.2, 5 texture{tx_olho}} sphere{<1, 0.0, 0.0>, 0.2, 5 texture{tx_nariz}} sphere{<0.8, 0.4, -0.3>, 0.2, -5 texture{tx_boca}} sphere{<0.8, 0.4, -0.3>, 0.2, -5 texture{tx_boca}} cylinder{<0.8, 0.4, -0.3>, <0.8, -0.4, -0.3>, 0.3, -5 texture{tx_boca}} threshold 0.5 } #macro mamao_anao(F) union { /* //object{mamao} //object{osso} //object{dedo_meio(30)} object{anao} object{eixos(10)}*/ blob { //mamao sphere{<0,0,0>, 1.5, 1.4*F texture{tx_verde}} sphere{<0,0,1>, 2, 0.7*F scale <0.9, 0.7, 1> texture{tx_laranja}} cylinder{F*<0, 0, 1.5>, F*<0,0,1.6>, 0.3, 1.2*F scale <0.9, 0.7, 1> texture{tx_laranja}} sphere_torus(0.15, 0.3, 7, 2*F, <0, 0, -0.9>, <0, 0, 0>, <1, 0.6, 1>, tx_laranja) //sphere{<0,-1.2,0>, 0.3, F*(-1) texture{tx_laranja}} //anao sphere{<0, 0, 0>, 2, (1-F)*1 texture{tx_pele}} sphere{<0.8, 0.4, 0.3>, 0.2, (1-F)*5 texture{tx_olho}} sphere{<0.8, -0.4, 0.3>, 0.2, (1-F)*5 texture{tx_olho}} sphere{<1, 0.0, 0.0>, 0.2, (1-F)*5 texture{tx_nariz}} sphere{<0.8, 0.4, -0.3>, 0.2, (1-F)*(-5) texture{tx_boca}} sphere{<0.8, 0.4, -0.3>, 0.2, (1-F)*(-5) texture{tx_boca}} cylinder{<0.8, 0.4, -0.3>, <0.8, -0.4, -0.3>, 0.3, (1-F)*(-5) texture{tx_boca}} threshold 0.5 } } #end mamao_anao((1+cos(2*pi*clock))/2)