// 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, 10, 40 >/5 // Posição do observador. right -0.64*x // Largura RELATIVA da imagem. up 0.48*y // Altura RELATIVA da imagem. sky y // 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 * < 0.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. } background { color rgb < 0.75, 0.80, 0.85 > } // ====================================================================== // 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.8,0.51 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_mamao = texture{ pigment{ color rgb < 0.2,0.9,0.2 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 reflection 0.1*< 0.6, 0.6, 0.6 > } } #declare tx_olho = texture{ pigment{ color rgb < 0, 0, 0 > } } #declare tx_nariz = texture{ pigment{ color rgb < 1, 0, 0 > } } // ====================================================================== // DESCRIÇÃO DA CENA //------- OBJETOS ----------- #macro mamao() blob { cylinder { < 0,0,0 >, < 0.4,0.4,0.4 >, 0.5, 1 } sphere { < 0.4,0.4,0.4 >, 1, 1 } sphere { < 0.58,0.58,0.58 >, 0.3, 1 } sphere { < -0.2,-0.2,-0.2 >, 0.2, -1 } threshold 0.5 texture { tx_mamao } } #end #macro mao( comp1_2, ang1_2, comp1_3, ang1_3, comp2_1, ang2_1, comp2_2, ang2_2, comp2_3, ang2_3, comp3_1, ang3_1, comp3_2, ang3_2, comp3_3, ang3_3, comp4_1, ang4_1, comp4_2, ang4_2, comp4_3, ang4_3, comp5_1, ang5_1, comp5_2, ang5_2, comp5_3, ang5_3 ) union { object { palma_da_mao() } object{ dedo2( comp1_2, ang1_2, comp1_3, ang1_3 ) rotate -45*z translate < 0.95,0.6,0 > } object{ dedo1( comp2_1, ang2_1, comp2_2, ang2_2, comp2_3, ang2_3 ) rotate -10*z translate < 0.2,1,0 > } object{ dedo1( comp3_1, ang3_1, comp3_2, ang3_2, comp3_3, ang3_3 ) rotate 10*z translate < -0.1,1,0 > } object{ dedo1( comp4_1, ang4_1, comp4_2, ang4_2, comp4_3, ang4_3 ) rotate 25*z translate < -0.4,0.9,0 > } object{ dedo1( comp5_1, ang5_1, comp5_2, ang5_2, comp5_3, ang5_3 ) rotate 30*z translate < -0.7,0.7,0 > } } #end #macro palma_da_mao() blob { //palma da mão sphere { < 0,0,0 >, 2, 1 } sphere { < 0,0,0.9 >, 1.5, -1 } sphere { < 0,0,-1.6 >, 2, -1 } cylinder { < 0.5,-1.8,0 >, < 2.5,0,0 >, 1, -1 } cylinder { < -1,-1.6,0 >, < 1,-1.6,0 >, 1, -1 } cylinder { < -0.5,-1.8,0 >, < -2.5,0,0 >, 1, -1 } cylinder { < 0.8,1.8,0 >, < 2,0.8,0 >, 1, -1 } cylinder { < -0.8,1.8,0 >, < -2.5,1,0 >, 1, -1 } threshold 0.5 texture { tx_fosca } } #end #macro dedo1( comp1, ang1, comp2, ang2, comp3, ang3 ) union { blob { sphere { < 0,0,0 >, 0.2, 1 } cylinder { < 0,0,0 >, < 0,comp1,0 >, 0.2, 1 } sphere { < 0,comp1,0 >, 0.2, 1 } threshold 0.5 texture { tx_fosca } } object { dedo2( comp2, ang2, comp3, ang3 ) translate < 0,comp1,0 > } } rotate ang1*x #end #macro dedo2( comp2, ang2, comp3, ang3 ) union { blob { sphere { < 0,0,0 >, 0.2, 1 } cylinder { < 0,0,0 >, < 0,comp2,0 >, 0.2, 1 } sphere { < 0,comp2,0 >, 0.2, 1 } threshold 0.5 texture { tx_fosca } } object { dedo3( comp3, ang3 ) translate < 0,comp2,0 > } } rotate ang2*x #end #macro dedo3( comp3, ang3 ) union { blob { sphere { < 0,0,0 >, 0.2, 1 } cylinder { < 0,0,0 >, < 0,comp3,0 >, 0.2, 1 } sphere { < 0,comp3,0 >, 0.2, 1 } threshold 0.5 texture { tx_fosca } } } rotate ang3*x #end #macro cabeca() blob { //cabeça sphere { < 0,0,0 >, 2, 1 } //olhos sphere { < -0.5,0.5,0.9 >, 0.25, 1 texture{ tx_olho } } sphere { < 0.5,0.5,0.9 >, 0.25, 1 texture{ tx_olho } } sphere { < 0,0,1 >, 0.3, 1 texture{ tx_nariz } } //orelhas sphere { < 1,0.3,0 >, 0.25, 1 } sphere { < -1,0.3,0 >, 0.25, 1 } //boca cylinder { < -0.8,-0.8,0.8 >, < 0.8,-0.8,0.8 >, 0.2, -1 texture{ tx_nariz } } threshold 0.5 texture { tx_fosca } } #end #macro mamao_ou_anao ( f ) blob { //--------- MAMÃO ----------- cylinder { < 0,0,0 >, < 0,0.4,0 >, 0.5, 1*(f) texture { tx_mamao } scale 1.5 } sphere { < 0,0.4,0 >, 1, 1*(f) texture { tx_mamao } scale 1.5 } sphere { < 0,0,0 >, 0.3, 1*(f) texture { tx_mamao } scale 1.5 } sphere { < 0,-0.35,0 >, 0.15, -1*(f) texture { tx_mamao } scale 1.5 } //---------- ANÃO --------- //cabeça sphere { < 0,0,0 >, 2, 1*(1-f) texture { tx_fosca } } //olhos sphere { < -0.5,0.5,0.9 >, 0.25, 1*(1-f) texture{ tx_olho } } sphere { < 0.5,0.5,0.9 >, 0.25, 1*(1-f) texture{ tx_olho } } sphere { < 0,0,1 >, 0.3, 1*(1-f) texture{ tx_nariz } } //orelhas sphere { < 1,0.3,0 >, 0.25, 1*(1-f) texture { tx_fosca } } sphere { < -1,0.3,0 >, 0.25, 1*(1-f) texture { tx_fosca } } //boca cylinder { < -0.8,-0.8,0.8 >, < 0.8,-0.8,0.8 >, 0.2, -1*(1-f) texture { tx_fosca } } threshold 0.5 } #end //------- CENA ----------- union { object { eixos(3.00) } object { mamao_ou_anao( ( 1+cos( 2*pi*clock ) ) /2 ) } /* object { mamao() rotate 90*x rotate -30*y translate < 1,-1,1 > } object { cabeca() } object { mao( 0.5,45,0.5,45, 0.5,45,0.5,45,0.5,45, 0.7,45,0.7,45,0.7,45, 0.5,45,0.5,45,0.5,45, 0.4,45,0.4,45,0.4,45 ) }*/ //rotate -90*y //rotate -30*z //rotate -90*x }