//ALUNO: Pedro Henrique Machado Martins camera{ location < 10.00, 10.00, 0.00 > // Posi��o do observador. right -1.2*x // Largura RELATIVA da imagem. up 0.9*y // 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{ 10 * < +50.0, +30.0, +50.0 > // Posi��o da l�mpada. color rgb 1.0 * < 1.00, 1.00, 1.00 > // Intensidade e cor da 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 cor da 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 < 1.00, 1.00, 1.00 > } //#include "nuvens.inc" #declare tx_plastico = texture{ pigment{ color rgb < 0.50, 0.50, 0.50 > } finish{ ambient 0.5 diffuse 0.5 reflection 0.25 * <1,1,1> } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 1.00, 1.00 > } finish{ ambient 0.1 diffuse 0.1 reflection 0.8 * <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_furo = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > filter 0.70 } finish{ diffuse 0.01 ambient 0.02} } #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_world = texture{ pigment{ color rgb < 1.0, 1.0, 1.0 > } finish{ diffuse 0.01 ambient 0.02} } #declare tx_mamao = texture{ pigment{ color rgb < 1.0, 0.55, 0.0 > } finish{ ambient 0.5 diffuse 0.5 } } #declare tx_mao = texture{ pigment{ color rgb < 0.75, 0.425, 0.0 > } finish{ ambient 0.5 diffuse 0.5 } } #declare tx_boca = texture{ pigment{ color rgb < 0.75, 0.00, 0.0 > } finish{ ambient 0.5 diffuse 0.75 } } #declare tx_olho = texture{ pigment{ color rgb < 0.00, 1.00, 1.00 > } finish{ ambient 0.5 diffuse 0.75 } } #declare tx_orelha = texture{ pigment{ color rgb < 1.00, 1.00, 0.00 > } finish{ ambient 0.5 diffuse 0.75 } } // ====================================================================== // DESCRI��O DA CENA /* Sintaxe: prism prism { conic_sweet bezier_spline altura 1 altura 2 nº de pontos ,,..., } lathe { bezier_spline nº de pontos ,,..., } */ #declare raio = 2.000; #macro mamao () union{ blob{ sphere { < 0.000, 0.000, 0.000 >, 1.00, 5.00 } sphere { < 0.000, 0.000, 0.500 >, 0.75, 5.00 } sphere { < 0.000, 0.000, -0.500 >, 0.75, 5.00 } sphere { < 0.000, 0.000, 0.875 >, 0.50, -1.5 } sphere { < 0.000, 0.000, -0.875 >, 0.50, -1.5 } threshold 0.5 texture {tx_mamao} } } #end /* #macro mao () union{ blob{ sphere { < 0.000, 0.000, 0.000 >, 1.00, 5.00 scale < 1.0, 0.3, 1.0 >} sphere { < 0.000, 0.000, 0.500 >, 0.85, 5.00 scale < 1.0, 0.3, 1.0 >} sphere { < 0.000, 0.000, -0.500 >, 0.65, 5.00 scale < 1.0, 0.3, 1.0 >} sphere { < 0.000, 0.000, 0.950 >, 0.50, -1.5 scale < 1.0, 0.3, 1.0 >} sphere { < 0.000, 0.000, -0.975 >, 0.50, -1.5 scale < 1.0, 0.5, 1.0 >} cylinder { < 0.650, 0.000, 0.700 >, < 0.800, 0.100, 1.900 >, 0.25, 0.75 } cylinder { < 0.300, 0.000, 0.725 >, < 0.350, 0.200, 2.250 >, 0.30, 0.75 } cylinder { < -0.150, 0.000, 0.725 >, < -0.150, 0.200, 2.350 >, 0.30, 0.75 } cylinder { < -0.650, 0.000, 0.725 >, < -0.700, 0.150, 2.050 >, 0.30, 0.75 } cylinder { < -0.650, 0.000, -0.150 >, < -1.100, 0.150, 0.850 >, 0.40, 0.75 } threshold 0.5 texture {tx_mamao} } } #end */ #macro dedo (comp1,comp2,comp3,raio) union{ blob{ sphere { < 0.000, 0.000, 0.000 >, raio*1.2, 5 } cylinder { < 0.000, 0.000, 0.000 >, < comp1, 0.000, 0.100 >, raio, 4 } threshold 0.5 } blob{ sphere { < comp1, 0.000, 0.100 >, raio*1.2, 5 } cylinder { < comp1, 0.000, 0.100 >, < comp1+comp2, 0.000, 0.200 >, raio, 4 } threshold 0.5 } blob{ sphere { < comp1+comp2, 0.000, 0.200 >, raio*1.2, 5 } cylinder { < comp1+comp2, 0.000, 0.200 >, < comp1+comp2+comp3, 0.000, 0.300 >, raio, 4 } threshold 0.5 } } texture {tx_mao} #end #macro polegar (comp1,comp2,raio) union{ blob{ sphere { < 0.000, 0.000, 0.000 >, raio*1.2, 5 } cylinder { < 0.000, 0.000, 0.000 >, < comp1, 0.000, 0.100 >, raio, 4 } threshold 0.5 } blob{ sphere { < comp1, 0.000, 0.100 >, raio*1.2, 5 } cylinder { < comp1, 0.000, 0.100 >, < comp1+comp2, 0.000, 0.200 >, raio, 4 } threshold 0.5 } } texture {tx_mao} #end #macro mao () union{ blob{ sphere { < 0.000, 0.000, 0.000 >, 1.00, 5.00 scale < 1.0, 0.3, 1.0 >} sphere { < 0.000, 0.000, 0.500 >, 0.85, 5.00 scale < 1.0, 0.3, 1.0 >} sphere { < 0.000, 0.000, -0.500 >, 0.65, 5.00 scale < 1.0, 0.3, 1.0 >} sphere { < 0.000, 0.000, 0.950 >, 0.50, -1.5 scale < 1.0, 0.3, 1.0 >} sphere { < 0.000, 0.000, -0.975 >, 0.50, -1.5 scale < 1.0, 0.5, 1.0 >} threshold 0.5 texture {tx_mamao} } //dedo 1 object{ dedo(0.375,0.375,0.25,0.125) rotate < -90.00, -60.00, 0.00 > translate < 0.550, 0.000, 0.700 > } //dedo 2 object{ dedo(0.50,0.50,0.40,0.125) rotate < -90.00, -75.00, 0.00 > translate < 0.200, 0.000, 0.800 > } //dedo 3 object{ dedo(0.55,0.55,0.45,0.125) rotate < -90.00, -90.00, 0.00 > translate < -0.150, 0.000, 0.800 > } //dedo 4 object{ dedo(0.45,0.45,0.30,0.125) rotate < -90.00, -105.00, 0.00 > translate < -0.500, 0.000, 0.700 > } //dedo 5 (polegar) object{ polegar(0.45,0.45,0.125) rotate < -90.00, -130.00, 0.00 > translate < -0.750, 0.000, 0.000 > } } #end #macro anao() union{ blob{ sphere { < 0.000, 0.000, 0.000 >, 2.00, 1.00 texture {tx_mamao} } sphere { < 0.000, 1.000, 0.000 >, 0.25, 1.00 texture {tx_mamao} } sphere { < 0.350, 0.750, 0.500 >, 0.25, 1.00 texture {tx_olho} } sphere { < -0.350, 0.750, 0.500 >, 0.25, 1.00 texture {tx_olho} } cylinder { < 0.350, 0.700, -0.500 >, < -0.350, 0.700, -0.500 >, 0.40, -0.75 texture {tx_boca} } sphere { < 0.900, 0.250, 0.600 >, 0.25, 1.00 texture {tx_orelha} } sphere { < -0.900, 0.250, 0.600 >, 0.25, 1.00 texture {tx_orelha} } threshold 0.5 translate z*4 } } #end #macro mamao_ou_anao(F) blob{ //mamao: sphere { < 0.000, 0.000, 0.000 >, 1.00, F*5.00 texture {tx_mamao}} sphere { < 0.000, 0.000, 0.500 >, 0.75, F*5.00 texture {tx_mamao}} sphere { < 0.000, 0.000, -0.500 >, 0.75, F*5.00 texture {tx_mamao}} sphere { < 0.000, 0.000, 0.875 >, 0.50, F*-1.5 texture {tx_mamao}} sphere { < 0.000, 0.000, -0.875 >, 0.50, F*-1.5 texture {tx_mamao}} //anao: sphere { < 0.000, 0.000, 0.000 >, 2.00, (1-F)*1.00 texture {tx_mamao} } sphere { < 0.000, 1.000, 0.000 >, 0.25, (1-F)*1.00 texture {tx_mamao} } sphere { < 0.350, 0.750, 0.500 >, 0.25, (1-F)*1.00 texture {tx_olho} } sphere { < -0.350, 0.750, 0.500 >, 0.25, (1-F)*1.00 texture {tx_olho} } cylinder { < 0.350, 0.700, -0.500 >, < -0.350, 0.700, -0.500 >, 0.40, (1-F)*-0.75 texture {tx_boca}} sphere { < 0.900, 0.250, 0.600 >, 0.25, (1-F)*1.00 texture {tx_orelha}} sphere { < -0.900, 0.250, 0.600 >, 0.25, (1-F)*1.00 texture {tx_orelha}} threshold 0.5 } #end // Cena: union { //object{ eixos(15.00) } //---------------------------- descomentar as próximas 2 linhas para ver a mão segurando o mamão -----------------------------// //object{ mao() rotate < 90.00, 0.00, 180.00 > } //object{ mamao() rotate < 90.00, 0.00, 180.00 > translate z*1.00 scale < 0.75,1.00,0.75 >} object{ mamao_ou_anao ( (1+cos(2*pi*clock))/2 ) } }