// ====================================================================== // CÂMERA camera{ location 2*< 14.00, 8.00, 2.50 > // Posição do observador. right -0.60*x // Largura RELATIVA da imagem. up 0.60*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 0.00, 1.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 background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_fosca = texture{ pigment{ color rgb < 0.92, 0.83, 0.8 > } finish{ diffuse 0.6 ambient 0.2 } } #declare tx_nariz = texture{ pigment{ color rgb < 0.80, 0.40, 0.24 > } finish{ diffuse 0.6 ambient 0.2 } } #declare tx_azul = texture{ pigment{ color rgb < 0, 0.50, 1.00 > } finish{ ambient 0.9 diffuse 0.8 } } #declare tx_vermelho = texture{ pigment{ color rgb < 1.00, 0.00, 0.00 > } finish{ ambient 0.2 diffuse 0.8 } } #declare tx_mamao1 = texture{ pigment{ color rgb < 0.89, 0.5, 0.01 > } finish{ diffuse 0.6 ambient 0.2 } } #declare tx_mamao2 = texture{ pigment{ color rgb < 0.85, 0.59, 0.1 > } finish{ diffuse 0.6 ambient 0.2 } } #declare tx_mamao3 = texture{ pigment{ color rgb < 0.88, 0.6, 0.2 > } finish{ diffuse 0.6 ambient 0.2 } } // ====================================================================== // DESCRIÇÃO DA CENA #declare mamao = blob { sphere{ <0,0,0>, 1.5, 1 texture{ tx_mamao1 } } sphere{ <0,2.2,0>, 3, 4 texture{ tx_mamao2 } } sphere{ <0,3.5,0>, 3, 2 texture{ tx_mamao1 } } sphere{ <0,4.8,0>, 2.2, 2 texture{ tx_mamao3 } } sphere{ <0,7,0>, 2, -1 } threshold 0.5 } #macro dedo(tam) blob { sphere{ <0,0,0>, 1, 2 } cylinder{ <0,0,0>, <0,tam,0>, 1.3, 2 } sphere{ <0,tam,0>, 1, 2 } threshold 0.5 texture{ tx_fosca } } #end #macro dedo2(tam1,tam2,ang1) union { object{ dedo(tam1) } object{ dedo(tam2) rotate ang1*x translate <0,tam1,0> } } #end #macro dedo3(tam1,tam2,tam3,ang1,ang2) union { object{ dedo(tam1) } object{ dedo2(tam2,tam3,ang2) rotate ang1*x translate <0,tam1,0> } } #end #macro palma() blob { sphere{ <0,-0.1,0>, 2.4, 2 scale<0.6,1.1,1> } sphere{ <0,-0.3,-0.7>, 2, 2 scale<0.6,1,1.2> } sphere{ <1,-0.2,-0.3>, 2, -2 scale<1,1,1> } threshold 0.5 texture{ tx_fosca } } #end #macro mao() union { object{ palma() translate<0,0.2,-1> scale<-2,2,2> rotate 90*y rotate 90*z } object{ dedo3(4,2,2,25,10) } object{ dedo3(3,2,1.5,20,5) rotate -10*z translate<2,0,0> } object{ dedo3(4,2,2,30,15) rotate 10*z translate<-1.7,-1,0> } object{ dedo3(2,2,2,30,20) rotate 20*z translate<-3,-2,0> } object{ dedo2(2,2,40) rotate -50*z translate<3,-2,0> } } #end #macro rosto() blob { sphere{ <0,0,0>, 5, 2 scale<0.7,0.8,0.8> } sphere{ <5,0,0>, 5, -1 scale<1.1,0.9,0.8> } //orelhas sphere{ <0,3,1>, 1, 1 scale<1.1,0.9,0.8> } sphere{ <0,-3,1>, 1, 1 scale<1.1,0.9,0.8> } //nariz sphere{ <2,0,0>, 1, 2 scale<1,1,0.9> texture{ tx_nariz} } //olhos sphere{ <2,1.2,1>, 0.5, 1 texture{ tx_azul } } sphere{ <2,-1.2,1>, 0.5, 1 texture{ tx_azul } } //boca sphere{ <2,0,-3>, 1, -2 scale<0.8,1.5,0.5> texture{ tx_vermelho } } threshold 0.5 texture{ tx_fosca } } #end #macro mamao_ou_anao(F) blob { sphere{ <0,0,0>, 1.5, F*1 texture{ tx_mamao1 } } sphere{ <0,2.2,0>, 3, F*4 texture{ tx_mamao2 } } sphere{ <0,3.5,0>, 3, F*2 texture{ tx_mamao1 } } sphere{ <0,4.8,0>, 2.2, F*2 texture{ tx_mamao3 } } sphere{ <0,7,0>, 2, F*-1 } sphere{ <0,0,0>, 5, (1-F)*2 scale<0.7,0.8,0.8> } sphere{ <5,0,0>, 5, (1-F)*-1 scale<1.1,0.9,0.8> } sphere{ <0,3,1>, 1, (1-F)*1 scale<1.1,0.9,0.8> } sphere{ <0,-3,1>, 1, (1-F)*1 scale<1.1,0.9,0.8> } sphere{ <2,0,0>, 1, (1-F)*2 scale<1,1,0.9> texture{ tx_nariz} } sphere{ <2,1.2,1>, 0.5, (1-F)*1 texture{ tx_azul } } sphere{ <2,-1.2,1>, 0.5, (1-F)*1 texture{ tx_azul } } sphere{ <2,0,-3>, 1, (1-F)*-2 scale<0.8,1.5,0.5> texture{ tx_vermelho } } threshold 0.5 texture{ tx_fosca } } #end #declare cena = union{ //object{ mamao } //object{ dedo3(5,4,3,40,50) } //object{ mao() } //object{ rosto() } object{ mamao_ou_anao((1+cos(2*pi*clock))/2) } } object{ cena rotate 40*z }