// 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 < 14.00, 7.00, 7.00 > // Posição do observador. right -0.60*x // Largura RELATIVA da imagem. up 0.45*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 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 #include "nuvens.inc" //background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_laranja = texture{ pigment{ color rgb < 1.00, 0.50, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_verde = texture{ pigment{ color rgb < 0.30, 0.80, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_amareloalaranjado = texture{ pigment{ color rgb < 1.00, 0.60, 0.00 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_vermelha = texture{ pigment{ color rgb < 0.80, 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_preta = texture{ pigment{ color rgb < 0, 0, 0 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_pele_clara = texture{ pigment{ color rgb <0.87, 0.66, 0.53 > } //222 170 135 finish{ diffuse 0.9 ambient 0.1 } } #declare tx_pele = texture{ pigment{ color rgb < 0.83, 0.55, 0.37 > } //211 141 95 finish{ diffuse 0.9 ambient 0.1 } } #declare tx_pele_escura = texture{ pigment{ color rgb < 0.80, 0.44, 0.28 > } // finish{ diffuse 0.9 ambient 0.1 } } #declare tx_metal = texture{ pigment{ color rgb < 0.50, 0.50, 0.50 > } finish{ diffuse 1 ambient 0.1 reflection 0.05 specular 0.8 roughness 0.005 } } #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 union{ #macro mamao() blob{ cylinder{<0, -1.8, 0>, <0, -1, 0>, 1.7, 1 texture {tx_fosca_laranja}} sphere{< 0, 0, 0>, 4, 1 texture {tx_fosca_amareloalaranjado}} cylinder{<0, 1, 0>, <0, 2, 0>, 2, 1 texture {tx_fosca_verde}} sphere{<0, 2.5, 0>, 1, -0.5} threshold 0.5 scale 0.5 } #end #macro ossinho1() blob{ //ossinho 1 sphere{<0,0,0>, 1.5, 1 texture {tx_pele} } cylinder{<0,1,0>, <0,2,0>, 1.9, 1 texture {tx_pele}} threshold 0.5 scale<1,1,0.9> } #end #macro ossinho2(beta) union{ blob{ //ossinho 2 sphere{<0,0,0>, 1.6, 1 texture {tx_pele_escura} } cylinder{<0,0.5,0>, <0,3.5,0>, 2, 1 texture {tx_pele}} sphere{<0,3.5,0>, 1.3, 1 texture {tx_pele_escura} } threshold 0.5 scale<1,1,0.9> } object{ossinho1() rotate beta*x translate 3.8*y } } #end #macro dedo(alfa, beta, pos) union{ blob{ //ossinho 3 sphere{<0,0,0>, 2.5, 1 texture {tx_pele_escura} } cylinder{<0,2,0>, <0,5,0>, 2.3, 1 texture {tx_pele} } sphere{<0,6,0>, 1.6, 1 texture {tx_pele_escura} } threshold 0.5 scale<1,1,0.9> } object{ossinho2(beta) rotate alfa*x translate 5.8*y } translate pos*x } #end #macro dedao(alfa, beta) union{ blob{ //ossinho 3 sphere{<0,0,0>, 2.5, 1 texture {tx_pele_escura} } cylinder{<0,2,0>, <0,5,0>, 2.3, 1 texture {tx_pele} } sphere{<0,6,0>, 1.6, 1 texture {tx_pele_escura} } threshold 0.5 scale<1,1,0.9> } object{ossinho2(beta) rotate alfa*x translate 5.8*y } scale<0.8,1,1> rotate -90*y translate<0,0,0> } #end #macro palma() blob{ cylinder{<4,0,0>, <4,10,0>, 3, 1 texture{tx_pele} } cylinder{<2,0,0>, <2,11,0>, 3, 1 texture {tx_pele} } cylinder{<0,0,0>, <0,11,0>, 3, 1 texture {tx_pele} } cylinder{<-1.8,3,0>, <-2,11,0>, 3, 1 texture {tx_pele} } cylinder{<-1,1,0>, <-4,5,0>, 3, 1 texture {tx_pele} } threshold 0.5 //scale 0.5 } #end #macro mao(alfa, beta, gama) union{ object{ palma() } object{dedo(alfa, beta, -2) rotate gama*x translate 11*y } object{dedo(alfa, beta, 0) rotate gama*x translate 11*y } object{dedo(alfa, beta, 2) rotate gama*x translate 11*y } object{dedo(alfa, beta, 4) rotate gama*x translate 11*y } //object{dedao(30,30) // rotate gama*x // //translate 11*y //} scale 0.5 } #end #macro anao() blob{ sphere{<0,0,0>, 8, 1 texture{tx_pele} scale<1,1,1>} sphere{<-2,2,3>, 1, 1 texture{tx_fosca_branca} } sphere{<2,2,3>, 1, 1 texture{tx_fosca_branca} } sphere{<0,0,4>, 1, 1 texture{tx_fosca_vermelha} } cylinder{<1.5,-2,3>, <-1.5,-2,3>, 1, -1 texture {tx_fosca_vermelha} } threshold 0.5 scale 0.5 } #end #macro mamao_ou_anao(F) blob{ //mamao cylinder{<0, -1.8, 0>, <0, -1, 0>, 1.7, F*1 texture {tx_fosca_laranja}} sphere{< 0, 0, 0>, 4, F*1 texture {tx_fosca_amareloalaranjado}} cylinder{<0, 1, 0>, <0, 2, 0>, 2, F*1 texture {tx_fosca_verde}} sphere{<0, 2.5, 0>, 1, F*-0.5} //anao sphere{<3,3,0>, 1, (1-F)*1 texture{tx_fosca_vermelha} } sphere{<-3,3,0>, 1, (1-F)*1 texture{tx_fosca_vermelha} } sphere{<-2,2,3>, 1, (1-F)*1 texture{tx_fosca_preta} } sphere{<2,2,3>, 1, (1-F)*1 texture{tx_fosca_preta} } sphere{<0,0,4>, 1, (1-F)*1 texture{tx_fosca_vermelha} } cylinder{<1.5,-2,3>, <-1.5,-2,3>, 1, (1-F)*-1 texture {tx_fosca_vermelha} } sphere{<0,0,0>, 8, (1-F)*1 texture{tx_pele_clara} scale<1,1,1>} threshold 0.5 scale 0.5 rotate 90*z rotate 90*y } #end union{ object{ eixos(3.00) } //o eixo é usado apenas durante a criação //object {anao() } //object {mamao() rotate 45*x translate <4,4,2> } //object {mao(70,70,45) scale 0.5 rotate 45*y} mamao_ou_anao((1 + cos(2*pi*clock))/2) //rotate -30*y } }