// 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 1.5 * < 14.00, 7.50, 7.50 > // Posição do observador. right -0.90*x // Largura RELATIVA da imagem. up 1.2*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 12.00, 8.00, 1.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_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.40, 0.40 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_amarelo = texture{ pigment{ color rgb < 1.00, 0.80, 0.20 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_cinza = texture{ pigment{ color rgb < 0.60, 0.60, 0.60 > } 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.50 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_quadro = texture{ pigment{ image_map{ jpeg "eu.jpg" } } finish{ diffuse 0.8 ambient 0.2 } } // ====================================================================== // DESCRIÇÃO DA CENA #declare raio = 2.000; // Exemplos: #declare ex_esfera = sphere{ < 0.00, 0.00, 0.00 >, raio texture{ tx_plastico } } #declare ex_esfera = cylinder{ < -2.00, +2.00, -1.00 >, < +2.00, -2.00, +1.00 >, 0.75 texture{ tx_fosca } } #declare ex_caixa = box{ < +0.00, +0.00, +3.00 >, < +3.00, +3.00, +0.00 > texture{ tx_fosca } } #declare ex_diferenca = difference{ object{ ex_caixa } union{ object{ ex_esfera } object{ ex_caixa } } } // Partes da cena: #declare membro = union{ cylinder{ < +0.00, +0.00, +0.00 >, < +0.00, +0.00, +1.30 >, 0.20 texture{ tx_amarelo } } sphere{ < +0.00, +0.00, +1.30 >, 0.26 texture{ tx_plastico } } } #macro galinha() union{ object{ corpo } } #end #declare milho = sphere{ < 0.00, 0.00, 0.00 >, +0.10 texture{ tx_amarelo } } #declare rabico = cone{ < +0.00, +0.00, +0.00 >, 0.00, < +0.00, -2.00, +0.00 >, 0.60 texture{ tx_fosca } } #macro galinha( pesc, cab_cima, cab_lado, pern1, can1, pe11, pe12, pern2, can2, pe21, pe22, pern3, can3, pe31, pe32, pern4, can4, pe41, pe42, pern5, can5, pe51, pe52, pern6, can6, pe61, pe62, asa11, asa12, asa13, asa14, asa21, asa22, asa23, asa24, asa31, asa32, asa33, asa34, asa41, asa42, asa43, asa44 ) union{ sphere{ < 0.00, -1.00, 0.00 >, +2.00 scale < +0.00, +2.00, +0.00 > texture{ tx_cinza } } object{ rabico rotate -30 * x translate < +0.00, -5.70, +0.50 > } union{ object{ cabeca_pescoco( cab_cima, cab_lado ) rotate pesc * x translate < +0.00, +1.60, +1.00 > } sphere{ < +0.00, +1.60, +1.00 >, 0.26 texture{ tx_plastico } } } object{ perna( can1, pe11, pe12 ) rotate pern1 * x translate < +1.60, -0.70, -1.00 > } object{ perna( can2, pe21, pe22 ) rotate pern2 * x translate < +1.80, -2.20, -1.00 > } object{ perna( can3, pe31, pe32 ) rotate pern3 * x translate < +1.60, -3.70, -1.00 > } object{ perna( can4, pe41, pe42 ) rotate pern4 * x translate < -1.60, -0.70, -1.00 > } object{ perna( can5, pe51, pe52 ) rotate pern5 * x translate < -1.80, -2.20, -1.00 > } object{ perna( can6, pe61, pe62 ) rotate pern6 * x translate < -1.60, -3.70, -1.00 > } object{ asa( asa13, asa14 ) rotate asa12 * y rotate asa11 * x translate < +1.70, -1.00, +1.00 > } object{ asa( asa23, asa24 ) rotate asa22 * y rotate asa21 * x translate < -1.70, -1.00, +1.00 > } object{ asa( asa33, asa34 ) rotate asa32 * y rotate asa31 * x translate < +1.70, -3.00, +1.00 > } object{ asa( asa43, asa44 ) rotate asa42 * y rotate asa41 * x translate < -1.70, -3.00, +1.00 > } } #end #macro asa( a, ante ) union{ object{ membro translate < +0.00, +0.00, -1.30 > } object{ asa_ante( ante ) rotate a * x translate < +0.00, +0.00, -1.30 > } } #end #macro asa_ante( a ) union{ object{ membro translate < +0.00, +0.00, -1.30 > } object{ asa_ponta rotate a * x translate < +0.00, +0.00, -1.30 > } } #end declare asa_ponta = union{ cone{ < +0.00, +0.00, +0.00 >, 0.20, < +0.00, -1.30, +0.00 >, 0.00 texture{ tx_amarelo } } sphere{ < +0.00, +0.00, +0.00 >, 0.26 texture{ tx_plastico } } } #macro cabeca_pescoco( a, b ) union{ object{ membro } object{ cabeca rotate a * x rotate b * z translate < +0.00, +0.00, +2.50 > } } #end #declare bico = cone{ < +0.00, +1.00, +0.00 >, +0.20, < +0.00, +1.50, +0.00 >, +0.00 texture{ tx_amarelo } } #declare cabeca = union{ sphere{ < 0.00, 0.00, 0.00 >, +1.00 texture{ tx_fosca } } object{ bico } sphere{ < 0.55, 0.55, 0.55 >, +0.10 texture{ tx_cinza } } sphere{ < -0.55, 0.55, 0.55 >, +0.10 texture{ tx_cinza } } } #macro perna( can, pe1, pe2 ) union{ object{ membro translate < +0.00, +0.00, -1.30 > } object{ canela( pe1, pe2 ) rotate can * x translate < +0.00, +0.00, -1.30 > } } #end #macro canela( a, b ) union{ object{ membro translate < +0.00, +0.00, -1.30 > } object{ pe rotate a * x rotate b * y translate < +0.00, +0.00, -1.40 > } } #end #declare pe = union{ sphere{ < +0.00, +0.00, +0.00 >, 0.26 texture{ tx_plastico } } box{ < -0.26, -0.26, -0.26 >, < +0.26, +0.60, -0.35 > texture{ tx_fosca } } } // Aqui está a cena, finalmente: // object{ galinha() } // object{ corpo( 320, 30 ) } // object{ perna( 40, 0, 0 ) } object{ galinha( -90, 30, 0, -30, 70, -40, 0, -30, 50, -20, 0, -30, 30, 0, 0, -30, 70, -40, 0, -30, 50, -20, 0, -30, 30, 0, 0, -100, -80, 120, 30, -100, 80, 120, 30, -100, -80, 120, 30, -100, 80, 120, 30 ) translate < +0.00, +2.00, +0.00 > rotate x * 340 } object{ galinha( -50, 30, -40, -30, 30, 0, 0, -30, 30, 0, 0, -30, 30, 0, 0, -30, 30, 0, 0, -30, 30, 0, 0, -30, 30, 0, 0, -100, -50, 120, 30, -100, 50, 120, 30, -100, -50, 120, 30, -100, 50, 120, 30 ) rotate z * -40 translate < +12.00, +8.00, +0.00 > } object{ milho translate < +5.00, +8.00, +0.00 > } object{ milho translate < +5.50, +7.00, +0.00 > } object{ milho translate < +6.50, +7.50, +0.00 > } object{ milho translate < +6.00, +8.00, +0.00 > } // object{ asa( 40, 30 ) }