// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2010-03-04 15:44:01 by stolfi // ====================================================================== // 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.80, 0.10 > } finish{ diffuse 0.5 ambient 0.5 } } #declare tx_grana = texture{ pigment{ color rgb < 0.15, 1.25, 0.65 > } finish{ diffuse 1.5 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRIÇÃO DA CENA #declare raio = 2.000; // Partes da cena: //modelando a parte estatica #macro orelha () union{ box{<-0.5,0,0>, <0.5,0.1,3> texture{tx_fosca}} cylinder{<0,0,3>, <0,0.1,3>, 0.5 texture{tx_fosca}} } #end #macro cabeca () union{ sphere{<0,0,0>, 1 texture{tx_fosca}} object{orelha() rotate<0,30,0>} object{orelha() rotate<0,-30,0>} } #end #macro corpo () union{ sphere{<0,0,0>, 1.5 texture{tx_fosca}} sphere{<0,0,1>, 1.5 texture{tx_fosca}} cylinder{<0,0,0>, <0,0,1>, 1.5 texture{tx_fosca}} object{cabeca() translate<0,0,3>} } #end //modelando os membros superiores #macro maozinha () union{ cone{<0,0,0>, 0.35, <0,0,1.4>, 0.4 texture{tx_fosca}} sphere{<0,0,1.4>, 0.45 texture{tx_fosca}} } #end #macro bracinho (COTOVELO) //COTOVELO precisa ser positivo, variando de 0 a 10 union{ sphere{<0,0,0>, 0.35 texture{tx_fosca}} cylinder{<0,0,0>, <0,0,1.6>, 0.35 texture{tx_fosca}} sphere{<0,0,1.6>, 0.35 texture{tx_fosca}} object{maozinha() rotate<0,16*COTOVELO,0> translate<0,0,1.6>} } #end //modelando os membros inferiores //pezinhos com botas #macro pezinho () union{ cone{<0,0,0>, 0.45, <0,0,1.5>, 0.6 texture{tx_fosca}} sphere{<0,0,0>, 0.45 texture{tx_fosca}} cylinder{<0,0,0.6>, <0,0,1.9>, 0.61 texture{tx_plastico}} sphere{<0,0,1.9>, 0.61 texture{tx_plastico}} } #end #macro perninha (TORNOZELO) //TORNOZELO precisa ser positivo, variando de 0 a 10 union{ cone{<0,0,0>, 0.35 <0,0,1.4>, 0.45 texture{tx_fosca}} sphere{<0,0,0>, 0.35 texture{tx_fosca}} object{pezinho() rotate<0,11*TORNOZELO,0> translate<0,0,1.6>} } #end #macro coxinha (JOELHO,TORNOZELO) //TORNOZELO e JOELHO precisam ser positivos, variando de 0 a 10 union{ cylinder{<0,0,0>, <0,0,1.3>, 0.35 texture{tx_fosca}} sphere{<0,0,0>, 0.35 texture{tx_fosca}} object{perninha(TORNOZELO) rotate<0,(-16*JOELHO),0> translate<0,0,1.3>} } #end //AGORA MONTAREMOS O COELHO COMPLETO #macro coelho_de_botas (OMBRO_DIR, COTOVELO_DIR, OMBRO_ESQ, COTOVELO_ESQ, BACIA_DIR, JOELHO_DIR, TORNOZELO_DIR, BACIA_ESQ, JOELHO_ESQ, TORNOZELO_ESQ) union{ object{corpo()} object{bracinho(COTOVELO_DIR) scale<0,0,-1> rotate<(15*OMBRO_DIR),-10,0> translate<1.5,0,1.7>} object{bracinho(COTOVELO_ESQ) scale<0,0,-1> rotate<(15*OMBRO_ESQ),10,0> translate<-1.5,0,1.7>} object{coxinha(JOELHO_DIR,TORNOZELO_DIR) scale<0,0,-1> rotate<(8*BACIA_DIR),-10,0> translate<1,0,-0.5>} object{coxinha(JOELHO_ESQ,TORNOZELO_ESQ) scale<0,0,-1> rotate<(8*BACIA_ESQ),10,0> translate<-1,0,-0.5>} } #end #include "eixos.inc" // Aqui está a cena, finalmente: union{ object{coelho_de_botas(0,0,0,0,0,0,0,0,0,0)} object{coelho_de_botas(0,1,2,3,4,5,6,7,8,9) translate<5,0,0>} } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 15; #declare dir_camera = < 1.00, 2.50, 1.00 >; #declare dist_camera = 15; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)