// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2020-09-30 19:57:13 by jstolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico_verde = texture{ pigment{ color rgb < 0.10, 1.00, 0.70 > } finish{ diffuse 1.0 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_plastico_vermelho = texture{ pigment{ color rgb < 1.00, 0.00, 0.00 > } finish{ diffuse 1.0 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_plastico_azul = texture{ pigment{ color rgb < 0.00, 0.00, 1.00 > } finish{ diffuse 1.0 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca_amarela = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_vidro_verde = texture{ pigment{ color rgb < 0.00, 1.00, 0.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_fosca_vermelha = texture{ pigment{ color rgb <1.00, 0.20, 0.20> } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.15, 0.20, 0.65 >, color rgb < 0.10, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // MACROS #macro pegador(abertura) #local comprimento = 8; #local largura = 4; #local espessura = 2; #local raio_esfera = 3; union{ sphere { <0, 0, 0>, raio_esfera // , radius texture{tx_fosca_amarela} } box { <0, -largura/2, 0>, // near lower left corner, far upper right corner texture{ tx_fosca_vermelha } // translate <0, 0, 0> // } box { <0, -largura/2, 0>, // near lower left corner, far upper right corner texture{ tx_fosca_vermelha } rotate <0, abertura, 0> // translate <0, 0, 0> // } } #end #macro antebraco(abertura_punho, abertura_pegador) #local comprimento = 15; #local raio = 2; union{ cylinder { <0, 0, 0>, , raio // center of one end, center of other end, radius texture{ tx_plastico_vermelho } } object{ pegador(abertura_pegador) rotate <0, abertura_punho, 0> translate // } } #end #macro braco(abertur_cotovelo, abertura_punho, abertura_pegador) #local comprimento = 15; #local raio = 2; #local raio_esfera = 3; union{ sphere { <0, 0, 0>, raio texture { tx_fosca_amarela } } cylinder { <0, 0, 0>, , raio // center of one end, center of other end, radius texture{ tx_plastico_vermelho } } sphere { <0, 0, 0>, raio // , radius translate // texture { tx_fosca_amarela } } object{ antebraco(abertura_punho, abertura_pegador) rotate <0, abertur_cotovelo, 0> translate // } } #end #macro cabeca() #local raio_cabeca = 10; #local raio_olhos = 2; #local raio_boca = 3; #local separacao_angular_olhos = 45; difference{ sphere { <0, 0, 0>, raio_cabeca // , radius texture { tx_plastico_verde } } union{ sphere { , raio_olhos // , radius texture { tx_plastico_vermelho } rotate <0, 0, separacao_angular_olhos/2> } sphere { <0, raio_cabeca, 0>, raio_olhos // , radius texture { tx_plastico_vermelho } rotate <0, 0, -separacao_angular_olhos/2> } difference{ sphere { <0, 0, 0>, raio_boca // , radius texture { tx_plastico_azul } } box { <-raio_boca, -raio_boca, 0>, // near lower left corner, far upper right corner texture { tx_plastico_azul } } translate // rotate<0, 20, 45> } } } #end #macro pescoco() #local raio_pescoco = 4; #local comprimento_pescoco = 20; #local raio_cabeca = 10; union{ sphere { <0, 0, 0>, raio_pescoco // , radius texture { tx_fosca_amarela } } cylinder { <0, 0, 0>, <0, 0, comprimento_pescoco>, raio_pescoco // center of one end, center of other end, radius texture { tx_plastico_vermelho } } object{ cabeca() translate <0, 0, comprimento_pescoco> // } } #end #macro pe() #local comprimento = 9; #local largura = 4; #local espessura = 2; box { <0, -largura/2, -espessura/2>, // near lower left corner, far upper right corner texture{ tx_plastico_vermelho } } #end #macro perna(pitch_pe, yaw_pe) #local comprimento = 20; #local raio = 2; #local raio_esfera = 3; union{ sphere { <0, 0, 0>, raio // , radius texture { tx_fosca_amarela } } cylinder { <0, 0, 0>, <0, 0, -comprimento>, raio // center of one end, center of other end, radius texture { tx_plastico_vermelho } } sphere { <0, 0, -comprimento>, raio // , radius texture { tx_fosca_amarela } } object{ pe() rotate <0, pitch_pe, 0> rotate <0, 0, yaw_pe> translate <0, 0, -comprimento> // } } #end #macro robo( angulos_pescoco, abertur_cotovelo_a, abertura_punho_a, abertura_pegador_a, angulos_ombro_a, abertur_cotovelo_b, abertura_punho_b, abertura_pegador_b, angulos_ombro_b, roll_quadril_a, pitch_quadril_a, pitch_pe_a, yaw_pe_a, roll_quadril_b, pitch_quadril_b, pitch_pe_b, yaw_pe_b ) #local comprimento_corpo = 30; #local raio_corpo = 10; union{ cylinder { <0, 0, 0>, <0, 0, comprimento_corpo>, raio_corpo texture{ tx_plastico_verde } } object{ pescoco() rotate rotate <0, angulos_pescoco.y, 0> rotate <0, 0, angulos_pescoco.z> translate <0, 0, comprimento_corpo> } // braco_a object{ braco(abertur_cotovelo_a, abertura_punho_a, abertura_pegador_a) rotate rotate <0, angulos_ombro_a.y, 0> rotate <0, 0, angulos_ombro_a.z> translate <0, raio_corpo, 0.75*comprimento_corpo> } //braco_b object{ braco(abertur_cotovelo_b, abertura_punho_b, abertura_pegador_b) rotate rotate <0, angulos_ombro_b.y, 0> rotate <0, 0, angulos_ombro_b.z> translate <0, -raio_corpo, 0.75*comprimento_corpo> } //perna_a object{ perna(pitch_pe_a, yaw_pe_a) rotate rotate <0, pitch_quadril_a, 0> translate <0, raio_corpo/2, 0> } //perna_b object{ perna(pitch_pe_b, yaw_pe_b) rotate rotate <0, pitch_quadril_b, 0> translate <0, -raio_corpo/2, 0> } } #end #macro chao(first_x, first_y, first_z, second_x, second_y, second_z) box{ , } #end // Aqui est� a cena, finalmente: #include "eixos.inc" union{ object{ robo( <20, -20, -45>, -90, 0, 45, <20, 30, 20>, -20, 15, 60, <20, -45, -45>, -20, 20, 15, 45, -30, -45, 15, 45 ) translate <0, 0, 20> // } object{ robo( <15, -45, -45>, 0, 45, 90, <-20, 45, 30>, -10, 45, 90, <-20, -45, -45>, 60, 45, 15, 45, -60, -45, 15, 45 ) translate <0, -50, 20> } object{ robo( <20, -20, -22>, 90, 0, 45, <20, 30, 20>, -15, 90, 10, <90, -45, -45>, 30, 45, 15, 45, -30, -45, 15, 45 ) translate <0, 50, 20> } #local extensao_do_chao = 200; object{ chao(-extensao_do_chao, -extensao_do_chao, -2, extensao_do_chao, extensao_do_chao, 0) texture{ tx_xadrez }} // pegador(60) // antebraco(0, 45) // braco(-90, 0, 45) // cabeca() // pescoco() // pe() // perna(45, 45) } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 160.0; #declare dir_camera = < 20.00, 0.00, 10.00 >; #declare dist_camera = 2*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)