// 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.9 ambient 0.1 } } #declare tx_branca = texture{ pigment{ color rgb < 2, 2, 2> } } #declare tx_preta = texture{ pigment{ color rgb < 0, 0, 0> } } #declare tx_orelha = texture{ pigment{ color rgb < 0.80, 0.80, 0.8 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #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 #include "eixos.inc" // COELHO DE BOTAS!111111!!! #declare raio_cabeca = 0.5; #declare raio_olho = 0.2*raio_cabeca; #macro cranio(xc,yc,zc) difference { sphere { , raio_cabeca } box { , } } #end #macro orelha(xc,yc,zc) box { texture{tx_orelha} } #end #macro cabeca(xc,yc,zc) union { cranio(xc,yc,zc) box { texture{tx_orelha} } box { texture{tx_orelha} } box { texture{tx_preta} } box { texture{tx_branca} } box { texture{tx_branca} } sphere { raio_olho texture{tx_branca} } sphere { raio_olho texture{tx_branca} } } #end #declare rjunta = 0.15; #macro junta(xc,yc,zc) sphere { rjunta } #end #declare gpe = 0.15; #declare hpe = 0.3; #macro pe(xp,yp,zp,rot) union { box { } box { } translate<-xp,-yp+gpe,0> rotate<0,0,rot> translate } #end #declare lcorpo = 2.5*raio_cabeca; #declare hcorpo = 2; #macro corpo(xc,yc,zc) union { box { } } #end #declare ltotalperna = 0.7; #declare ltotalabraco = 0.5; #macro abraco(xc,yc,zc,rab,rb) union { cylinder{ 0.5*rjunta } junta(xc,yc+ltotalabraco,zc) braco(xc,yc+ltotalabraco+rjunta,zc,rb) translate<-xc,-yc,0> rotate<0,0,rab> translate } #end #macro braco(xc,yc,zc,rb) union { cylinder{ 0.5*rjunta } translate<-xc,-yc,0> rotate<0,0,rb> translate } #end #macro coxa(xc,yc,zc,rab,rb,rp) union { cylinder{ 0.5*rjunta } junta(xc,yc,zc-ltotalperna) perna(xc,yc,zc-ltotalperna-rjunta,rb,rp) translate<-xc,0,-zc> rotate<0,rab,0> translate } #end #macro perna(xc,yc,zc,rb,rp) union { cylinder{ 0.5*rjunta } pe(xc,yc,zc-ltotalperna,rp) translate<-xc,0,-zc> rotate<0,rb,0> translate } #end #declare NQ = 6; #declare pe_esq = array[NQ] {0,-90,0,90,0,0}; #declare pe_dir = array[NQ] {0,90,0,-90,0,0}; #declare perna_esq = array[NQ] {60,0,-60,-60,0,0}; #declare perna_dir = array[NQ] {0,0,-60,-60,0,0}; #declare coxa_esq = array[NQ] {-30,0,30,30,0,0}; #declare coxa_dir = array[NQ] {0,0,30,30,0,0}; #declare abraco_esq = array[NQ] {0,0,105,0,0,105}; #declare abraco_dir = array[NQ] {0,-105,0,0,-105,0}; #declare braco_esq = array[NQ] {0,110,-110,105,90,75}; #declare braco_dir = array[NQ] {0,-75,75,-105,-75,-90}; #declare tempo = array[NQ] {0,0.2,0.4,0.6,0.8,1.0}; #macro quadro_anterior(fase) #local i=0; #while (i= fase))) #local resp = 1; #end #local i = i+1; #end resp #end //#macro coelho_de_botas(rotpe_esq,rotpe_dir,r_ab_dir, //r_b_dir,r_ab_esq,r_b_esq,rce,rpe,rcd,rpd) #macro boneco_dancando(fase) object{coelho_de_botas(pe_esq[0],pe_dir[0],abraco_dir[0],braco_dir[0], abraco_esq[0],braco_esq[0],coxa_esq[0],perna_esq[0],coxa_dir[0], perna_dir[0])} #end #macro quadro_anterior(fase) #end #macro interpola(f0,v0,f1,v1,f) #local ss = (f-f0)/(f1-f0); #local rr = 1-ss-(rr*v0+ss*v1); #end #macro coelho_de_botas(rotpe_dir,rotpe_esq,r_ab_esq, r_b_esq,r_ab_dir,r_b_dir,rcd,rpd,rce,rpe) #declare xcorpo = 0; #declare ycorpo = 0; #declare zcorpo = 0; union { cabeca(xcorpo,ycorpo+lcorpo/2,zcorpo+raio_cabeca) corpo(xcorpo,ycorpo,zcorpo) junta(xcorpo-rjunta,ycorpo-rjunta,zcorpo-rjunta)//besq junta(xcorpo-rjunta,ycorpo+rjunta+lcorpo,zcorpo-rjunta)//bdir junta(xcorpo-rjunta,ycorpo+rjunta,zcorpo-hcorpo-rjunta) junta(xcorpo-rjunta,ycorpo+lcorpo-rjunta,zcorpo-hcorpo-rjunta) //braco direito abraco(xcorpo-rjunta,ycorpo+2*rjunta+lcorpo,zcorpo-rjunta,r_ab_dir,r_b_dir) //braco esq union{ abraco(xcorpo-rjunta,ycorpo+2*rjunta,zcorpo-rjunta,r_ab_esq,r_b_esq) scale<1,-1,1> } //perna esq coxa(xcorpo-rjunta,ycorpo+rjunta,zcorpo-hcorpo-2*rjunta,rce,rpe,rotpe_esq) //perna dir coxa(xcorpo-rjunta,ycorpo+lcorpo-rjunta,zcorpo-hcorpo-2*rjunta,rcd,rpd,rotpe_dir) } #end // Aqui está a cena, finalmente: union{ object{ eixos(3.00) } object{ boneco_dancando(0) texture{tx_fosca} } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 14; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)