// 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.0, 0.00, 0 > // Posição do observador. right -0.45*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, 0.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 0.75 * < 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.35 * < 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 < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_preta = texture{ pigment{ color rgb < 0.00, 0.00, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_branca = texture{ pigment{ color rgb < 1.00, 1.00, 1.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_vermelha = texture{ pigment{ color rgb < 1.00, 0.00, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_verde = texture{ pigment{ color rgb < 0.00, 1.00, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_azul = texture{ pigment{ color rgb < 0.00, 0.00, 1.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca2 = texture{ pigment{ color rgb < 1.00, 0.10, 0.10 > } 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 < 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 } } // ====================================================================== // DESCRIÇÃO DA CENA #macro mamao() blob { // corpo sphere{ <0, 3, 0.0>, 1, 1 texture {tx_fosca} } sphere{ <0, 3, 0.75>, 1.75, 1 texture {tx_fosca}} // ponta inicial cylinder{ <0,2.95,1.5>, <0,3.05,1.5>, 0.75, 1 texture {tx_fosca_verde}} // ponta final cylinder{ <0,3,0>, <0,3,-0.5>, 0.75, 1 texture {tx_fosca}} // depressão na ponta inicial sphere{ <0, 3, 2.2>, 0.5, -1 } threshold 0.5 } #end #macro mamao_centro() blob { // corpo sphere{ <0, 0, 0.0>, 1, 1 texture {tx_fosca} } sphere{ <0, 0, 0.75>, 1.75, 1 texture {tx_fosca}} // ponta inicial cylinder{ <0,-0.05,1.5>, <0,0.05,1.5>, 0.75, 1 texture {tx_fosca_verde}} // ponta final cylinder{ <0,0,0>, <0,0,-0.5>, 0.75, 1 texture {tx_fosca}} // depressão na ponta inicial sphere{ <0, 0, 2.2>, 0.5, -1 } threshold 0.5 } #end #macro dedo3(raio) blob { cylinder{ <0, 0, 0>, <0, 1, 0>, raio, 1} sphere{ <0,0,0>, raio + raio*0.5, 1} sphere{ <0,1,0>, raio + raio*0.5, 1} threshold 0.5 texture{ tx_fosca } } #end #macro dedo2(alfa2,raio) union { blob { cylinder{ <0, 0, 0>, <0, 1.5, 0>, raio, 1} sphere{ <0,0,0>, raio + raio*0.5, 1} sphere{ <0,1.5,0>, raio + raio*0.5, 1} threshold 0.5 texture{ tx_fosca } } object{ dedo3(raio) rotate alfa2*x translate <0,1.5,0> } } #end #macro dedo(alfa1, alfa2, comprimento, raio) union { blob { cylinder{ <0, 0, 0>, <0, comprimento, 0>, raio, 1} sphere{ <0,0,0>, raio + raio*0.5, 1} sphere{ <0,comprimento,0>, raio+ raio*0.5, 1} threshold 0.5 texture{ tx_fosca } } object{ dedo2(alfa2, raio) rotate alfa1*x translate <0,comprimento,0> } } #end #macro mao() union { blob { cylinder{ <0, 0.6, 0>, <0, 3.3, 0>, 0.4, 1} cylinder{ <0, 0.4, 0.4>, <0, 3.4, 0.4>, 0.4, 1} cylinder{ <0, 0.2, 0.8>, <0, 3.5 0.8>, 0.4, 1} cylinder{ <0, 0, 1.2>, <0, 3.5 1.2>, 0.4, 1} cylinder{ <0, 0, 1.6>, <0, 3.5, 1.6>, 0.4, 1} cylinder{ <0, 0, 2>, <0, 3.5, 2.0>, 0.4, 1} cylinder{ <0, 0, 2.4>, <0, 3.5, 2.4>, 0.4, 1} cylinder{ <0, 0.1, 2.8>, <0, 3.5, 2.8>, 0.4, 1} cylinder{ <0, 0.2, 3.2>, <0, 3.4, 3.2>, 0.4, 1} cylinder{ <0, 0.3, 3.6>, <0, 3.3, 3.6>, 0.4, 1} threshold 0.5 texture{ tx_fosca } } object{ dedo(45, 45, 1.5, 0.3) rotate 90*x rotate 90*z translate <0, 0.3, 3.6>} object{ dedo(45, 45, 1.5, 0.3) rotate 90*x rotate 90*z translate <0, 1.3, 3.6>} object{ dedo(45, 45, 1.5, 0.3) rotate 90*x rotate 90*z translate <0, 2.3, 3.6>} object{ dedo(45, 45, 1.5, 0.3) rotate 90*x rotate 90*z translate <0, 3.3, 3.6>} object{ dedo2(45, 0.3) rotate 90*x rotate 90*z rotate 30*x translate <0, 0, 1.2> } } #end #macro anao() blob{ // cabeça sphere{ <0, 0, 0>, 3, 1 texture{tx_fosca_branca} } // olhos sphere{ <1.3, -0.5, 0.5>, 0.3, 1 texture{tx_fosca_vermelha} } sphere{ <1.3, 0.5, 0.5>, 0.3, 1 texture{tx_fosca_preta} } // nariz sphere{ <1.5, 0.0, 0.0>, 0.3, 2 texture{tx_fosca_verde} } // boca cylinder{<1.3, -0.5, -0.5>, <1.3, 0.5, -0.5>, 0.3, 1 texture{tx_fosca_azul} } threshold 0.5 } #end #macro mamao_ou_anao(F) blob{ // anao +++++++++++++++++++++++++++++++++ // cabeça sphere{ <0, 0, 0>, 3, (1-F)*1 texture{tx_fosca_branca} } // olhos sphere{ <1.3, -0.5, 0.5>, 0.3, (1-F)*1 texture{tx_fosca_vermelha} } sphere{ <1.3, 0.5, 0.5>, 0.3, (1-F)*1 texture{tx_fosca_preta} } // nariz sphere{ <1.5, 0.0, 0.0>, 0.3, (1-F)*2 texture{tx_fosca_verde} } // boca cylinder{<1.3, -0.5, -0.5>, <1.3, 0.5, -0.5>, 0.3, (1-F)*1 texture{tx_fosca_azul} } // mamao +++++++++++++++++++++++++++++++ // corpo sphere{ <0, 0, 0.0>, 1, F*1 texture {tx_fosca} } sphere{ <0, 0, 0.75>, 1.75, F*1 texture {tx_fosca}} // ponta inicial cylinder{ <0,-0.05,1.5>, <0,0.05,1.5>, 0.75, F*1 texture {tx_fosca_verde}} // ponta final cylinder{ <0,0,0>, <0,0,-0.5>, 0.75, F*1 texture {tx_fosca}} // depressão na ponta inicial sphere{ <0, 0, 2.2>, 0.5, F*-1 } threshold 0.5 } #end // declaração da cena union { eixos(4) /* object { mamao() rotate 90*x translate<0, 3, -1.9>} object{ mao() rotate 90*z rotate 90* x translate <0,5,0>} */ //object{ mamao_ou_anao(clock) } object{ mamao_ou_anao(1 + cos(2*pi*clock) / 2) } }