// 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 } } // ====================================================================== // DESCRIÇÃO DA CENA /* #declare raio = 1.000; // Partes da cena: #declare bolinha = sphere{ < 0,0,0 >, 0.60 } #declare bolota = sphere{ < 0,0,0 >, 1.50 } #declare bola = sphere{ < 0.00, 0.00, 0.00 >, raio texture{ tx_plastico } } #declare pino = cylinder{ < -2.00, +2.00, -1.00 >, < +2.00, -2.00, +1.00 >, 0.75 texture{ tx_vidro } } #declare furo = cylinder{ < +1.00, +2.00, -2.00 >, < -1.00, -2.00, +2.00 >, 0.75*raio texture{ tx_espelho } } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } */ #include "eixos.inc" #macro cabeca () sphere{ < 0,0,3 >, 0.5 texture{ tx_plastico } } #end #macro pescoco () cylinder{ <0,0,2.3>,<0,0,2.5>,0.1 texture{ tx_plastico } } #end #macro pe () box{ <0,0,0>,<0.6,0.2,0.1> texture{ tx_plastico } } #end #macro mao () box{ <0,0,0>,<0.2,0.6,0.1> texture{ tx_plastico } } #end #macro corpo () box{ <0.3,-0.3,1>,<-0.3,0.3,2.3> texture{ tx_plastico } } #end #macro orelha () cone{ <0,0,0>,0.2,<0,0,0.2>,0.1 texture{ tx_plastico } } #end #macro coxa () cylinder{ <0,0,0>,<0,0,-0.8>,0.07 texture{ tx_plastico } } #end #macro peinf () cylinder{ <0,0,0>,<0,0,-0.4>,0.07 texture{ tx_plastico } } #end #macro subperna(a) union{ object{ peinf() } object{ pe() rotate<0,a,0> translate<0,-0.09,-0.4>} } #end #macro perna(a,b) union{ object{ coxa() } object{ subperna(a) rotate<0,b,0> translate<0,0,-0.8> } } #end #macro antebraco() cylinder{ <0,0,0>,<0,0.4,0>,0.07 texture{ tx_plastico } } #end #macro subbraco(a) union{ object{ antebraco() } object{ mao() rotate translate<0,0.4,0>} } #end #macro muc() cylinder{ <0,0,0>,<0,0.4,0>,0.07 texture{ tx_plastico } } #end #macro braco(a,b) union{ object{ muc() } object{ subbraco(b) rotate translate<0,0.4,0> } } #end // Aqui está a cena, finalmente: object{ eixos(3.00) } #macro boneco(a,b,c,d,e,f,g,h,i,j) union{ object { cabeca() } object { pescoco() } object { corpo() } object { orelha() rotate <-30,0,0> translate <0,0.3,3.4> } object { orelha() rotate <30,0,0> translate <0,-0.3,3.4> } object { perna(a,b) rotate<0,i,0> translate<0,0.2,1> } object { perna(c,d) rotate<0,j,0> translate<0,-0.2,1> } object { braco(e,f) translate<0,0.3,2> } object { braco(g,h) translate<0,0.3,2> scale<1,-1,1> } } #end object { boneco(0,0,0,0,0,0,0,0,-45,45) translate<0,-2,0>} /* #macro interpola(f0,v0,f1,v1,f) #local ss=(f-f0)/(f1-f0); #local rr=1-ss; (rr*v0 +ss*v1) #end //Declarações do movimento #declare NQ = 7; //num de quadros #declare argA = array[NQ]; #declare argA[0] = 45; #declare argA[1] = 15; #declare argA[2] = -15; #declare argA[3] = -45; #declare argA[4] = -15; #declare argA[5] = 15; #declare argA[6] = 45; #declare argB = array[NQ]; #declare argB[0] = 75; #declare argB[1] = 15; #declare argB[2] = -15; #declare argB[3] = -75; #declare argB[4] = -15; #declare argB[5] = 15; #declare argB[6] = 75; #declare argC = array[NQ]; #declare argC[0] = -75; #declare argC[1] = -45; #declare argC[2] = -15; #declare argC[3] = 0; #declare argC[4] = -15; #declare argC[5] = -45; #declare argC[6] = -75; #declare argD = array[NQ]; #declare argD[0] = 75; #declare argD[1] = 45; #declare argD[2] = 15; #declare argD[3] = 0; #declare argD[4] = 15; #declare argD[5] = 45; #declare argD[6] = 75; #declare tempo = array[NQ]; #declare tempo[0] = 0.0; #declare tempo[1] = 0.17; #declare tempo[2] = 0.34; #declare tempo[3] = 0.50; #declare tempo[4] = 0.67; #declare tempo[5] = 0.74; #declare tempo[6] = 1.0; #macro quadroanterior(fase) #local i=0; #while(i=fase))) #local resp=1; #end #local i=i+1; resp #end #macro boneco_dancando(fase) #if ((fase>=tempo[0]) &(fase=tempo[1]) &(fase=tempo[2]) &(fase=tempo[3]) &(fase=tempo[4]) &(fase=tempo[5]) &(fase; #declare raio_cena = 6.0; #declare dir_camera = < 1.00, -1.00, 0.00 >; #declare dist_camera = 80.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)