// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2017-05-07 20:10:09 by stolfilocal // ====================================================================== // 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_peca = texture{ pigment{ color rgb < 0.5, 0.5, 0.5 > } finish{ diffuse 0.9 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.0, 0.0, 0.0 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 1.0 } // ====================================================================== // DESCRIÇÃO DA CENA #include "eixos.inc" #declare raio = 1; #declare altura = 4; #declare tx = tx_espelho #declare artic = sphere {<0,0,0>, raio texture {tx}} #declare seg = cylinder {<0,0,raio/2>, <0,0,altura>, raio texture {tx}} #macro perna() #union{ object {artic} object {seg} } #end #macro perna2(ang) #union{ object { perna() } object { perna() rotate translate <0, 0, altura> } } #end #macro perna3(ang1, ang2) #union{ object { perna() } object { perna2(ang1) rotate translate <0, 0, altura> } } #end #macro perna4(ang1, ang2, ang3) #union{ object { perna() } object { perna3(ang1, ang2) rotate translate <0, 0, altura> } } #end #macro perna5(ang1, ang2, ang3, ang4) #union{ object { perna() } object { perna4(ang1, ang2, ang3) rotate translate <0, 0, altura> } } #end #macro perna6(ang1, ang2, ang3, ang4, ang5) #union{ object { perna() } object { perna5(ang1, ang2, ang3, ang4) rotate translate <0, 0, altura> } } #end //perna6(45, -45, 45, -45, 45) #declare bug = array[6][6][5] #declare bug[0][0][0] = 45; #declare bug[0][0][1] = -45; #declare bug[0][0][2] = 45; #declare bug[0][0][3] = -45; #declare bug[0][0][4] = 45; #declare bug[0][1][0] = -45; #declare bug[0][1][1] = 45; #declare bug[0][1][2] = -45; #declare bug[0][1][3] = 45; #declare bug[0][1][4] = -45; #declare bug[0][2][0] = 45; #declare bug[0][2][1] = -45; #declare bug[0][2][2] = 45; #declare bug[0][2][3] = -45; #declare bug[0][2][4] = 45; #declare bug[0][3][0] = -45; #declare bug[0][3][1] = 45; #declare bug[0][3][2] = -45; #declare bug[0][3][3] = 45; #declare bug[0][3][4] = -45; #declare bug[0][4][0] = 45; #declare bug[0][4][1] = -45; #declare bug[0][4][2] = 45; #declare bug[0][4][3] = -45; #declare bug[0][4][4] = 45; #declare bug[0][5][0] = -45; #declare bug[0][5][1] = 45; #declare bug[0][5][2] = -45; #declare bug[0][5][3] = 45; #declare bug[0][5][4] = -45; #declare bug[1][0][0] = 45; #declare bug[1][0][1] = -45; #declare bug[1][0][2] = 45; #declare bug[1][0][3] = -45; #declare bug[1][0][4] = 45; #declare bug[1][1][0] = -45; #declare bug[1][1][1] = 45; #declare bug[1][1][2] = -45; #declare bug[1][1][3] = 45; #declare bug[1][1][4] = -45; #declare bug[1][2][0] = 45; #declare bug[1][2][1] = -45; #declare bug[1][2][2] = 45; #declare bug[1][2][3] = -45; #declare bug[1][2][4] = 45; #declare bug[1][3][0] = -45; #declare bug[1][3][1] = 45; #declare bug[1][3][2] = -45; #declare bug[1][3][3] = 45; #declare bug[1][3][4] = -45; #declare bug[1][4][0] = 45; #declare bug[1][4][1] = -45; #declare bug[1][4][2] = 45; #declare bug[1][4][3] = -45; #declare bug[1][4][4] = 45; #declare bug[1][5][0] = -45; #declare bug[1][5][1] = 45; #declare bug[1][5][2] = -70; #declare bug[1][5][3] = -40; #declare bug[1][5][4] = -60; #declare bug[2][0][0] = 45; #declare bug[2][0][1] = -45; #declare bug[2][0][2] = 45; #declare bug[2][0][3] = -45; #declare bug[2][0][4] = 45; #declare bug[2][1][0] = -45; #declare bug[2][1][1] = 45; #declare bug[2][1][2] = -45; #declare bug[2][1][3] = 45; #declare bug[2][1][4] = -45; #declare bug[2][2][0] = 45; #declare bug[2][2][1] = -45; #declare bug[2][2][2] = 45; #declare bug[2][2][3] = -45; #declare bug[2][2][4] = 45; #declare bug[2][3][0] = -45; #declare bug[2][3][1] = 45; #declare bug[2][3][2] = -45; #declare bug[2][3][3] = 45; #declare bug[2][3][4] = -45; #declare bug[2][4][0] = 45; #declare bug[2][4][1] = -10; #declare bug[2][4][2] = 45; #declare bug[2][4][3] = -70; #declare bug[2][4][4] = -80; #declare bug[2][5][0] = -45; #declare bug[2][5][1] = 45; #declare bug[2][5][2] = -45; #declare bug[2][5][3] = 45; #declare bug[2][5][4] = -45; #declare bug[3][0][0] = 45; #declare bug[3][0][1] = -45; #declare bug[3][0][2] = 45; #declare bug[3][0][3] = -45; #declare bug[3][0][4] = 45; #declare bug[3][1][0] = -45; #declare bug[3][1][1] = 45; #declare bug[3][1][2] = -45; #declare bug[3][1][3] = 45; #declare bug[3][1][4] = -45; #declare bug[3][2][0] = 45; #declare bug[3][2][1] = -45; #declare bug[3][2][2] = 45; #declare bug[3][2][3] = -45; #declare bug[3][2][4] = 45; #declare bug[3][3][0] = -80; #declare bug[3][3][1] = -25; #declare bug[3][3][2] = 75; #declare bug[3][3][3] = -25; #declare bug[3][3][4] = 75; #declare bug[3][4][0] = 45; #declare bug[3][4][1] = -45; #declare bug[3][4][2] = 45; #declare bug[3][4][3] = -45; #declare bug[3][4][4] = 45; #declare bug[3][5][0] = -45; #declare bug[3][5][1] = 45; #declare bug[3][5][2] = -45; #declare bug[3][5][3] = 45; #declare bug[3][5][4] = -45; #declare bug[4][0][0] = 45; #declare bug[4][0][1] = -45; #declare bug[4][0][2] = 45; #declare bug[4][0][3] = -45; #declare bug[4][0][4] = 45; #declare bug[4][1][0] = 45; #declare bug[4][1][1] = 10; #declare bug[4][1][2] = -75; #declare bug[4][1][3] = 15; #declare bug[4][1][4] = -75; #declare bug[4][2][0] = 45; #declare bug[4][2][1] = -45; #declare bug[4][2][2] = 45; #declare bug[4][2][3] = -45; #declare bug[4][2][4] = 45; #declare bug[4][3][0] = -45; #declare bug[4][3][1] = 45; #declare bug[4][3][2] = -45; #declare bug[4][3][3] = 45; #declare bug[4][3][4] = -45; #declare bug[4][4][0] = 45; #declare bug[4][4][1] = -45; #declare bug[4][4][2] = 45; #declare bug[4][4][3] = -45; #declare bug[4][4][4] = 45; #declare bug[4][5][0] = -45; #declare bug[4][5][1] = 45; #declare bug[4][5][2] = -45; #declare bug[4][5][3] = 45; #declare bug[4][5][4] = -45; #declare bug[5][0][0] = 45; #declare bug[5][0][1] = -45; #declare bug[5][0][2] = 45; #declare bug[5][0][3] = -45; #declare bug[5][0][4] = 45; #declare bug[5][1][0] = -45; #declare bug[5][1][1] = 45; #declare bug[5][1][2] = -45; #declare bug[5][1][3] = 45; #declare bug[5][1][4] = -45; #declare bug[5][2][0] = 45; #declare bug[5][2][1] = -45; #declare bug[5][2][2] = 45; #declare bug[5][2][3] = -45; #declare bug[5][2][4] = 45; #declare bug[5][3][0] = -45; #declare bug[5][3][1] = 45; #declare bug[5][3][2] = -45; #declare bug[5][3][3] = 45; #declare bug[5][3][4] = -45; #declare bug[5][4][0] = 45; #declare bug[5][4][1] = -45; #declare bug[5][4][2] = 45; #declare bug[5][4][3] = -45; #declare bug[5][4][4] = 45; #declare bug[5][5][0] = -45; #declare bug[5][5][1] = 45; #declare bug[5][5][2] = -45; #declare bug[5][5][3] = 45; #declare bug[5][5][4] = -45; #macro inseto(bug) #union{ object { box { <-20,-10,-5>, <20, 10, 5> texture {tx}} } object { perna6(bug[0][0], bug[0][1], bug[0][2], bug[0][3], bug[0][4]) translate <0,10,5> rotate <150,0,0>} object { perna6(bug[1][0], bug[1][1], bug[1][2], bug[1][3], bug[1][4]) translate <-10,10,5> rotate <150,0,0>} object { perna6(bug[2][0], bug[2][1], bug[2][2], bug[2][3], bug[2][4]) translate <10,10,5> rotate <150,0,0>} object { perna6(bug[3][0], bug[3][1], bug[3][2], bug[3][3], bug[3][4]) translate <0,10,5> rotate <150,0,180>} object { perna6(bug[4][0], bug[4][1], bug[4][2], bug[4][3], bug[4][4]) translate <-10,10,5> rotate <150,0,180>} object { perna6(bug[5][0], bug[5][1], bug[5][2], bug[5][3], bug[5][4]) translate <10,10,5> rotate <150,0,180>} } #end #macro vetorK(n_chaves) #local tk = array[n_chaves]; #local i = 0; #while (i < n_chaves) #local tk[i] = i/(n_chaves-1); #local i = i + 1; #end tk #end #macro buscaTempo(clk, n_chaves, tk) #local i = 0; #while (tk[i] < clk) #local i = i + 1; #end #if (i = 0) #local r = i; #else #local r = i - 1; #end r #end #macro interpolar(t0, v0, t1, v1, tt) #local r = (tt - t0)/(t1 - t0); #local s = 1 - r; #local vv = s*v0 + r*v1; vv #end #macro arcobezier(t0, t1, A, B, C, D, tt) #local AB = interpolar(t0, A, t1, B, tt); #local BC = interpolar(t0, B, t1, C, tt); #local CD = interpolar(t0, C, t1, D, tt); #local ABC = interpolar(t0, AB, t1, BC, tt); #local BCD = interpolar(t0, BC, t1, CD, tt); #local ABCD = interpolar(t0, ABC, t1, BCD, tt); ABCD #end #macro inteporlaQuadros(NP, NA, Q, k0, k1, t0, t1, tt, A) #local i = 0; #local j = 0; #while (i < NP) #while (j < NA) #declare A[i][j] = interpolar(t0, Q[k0][i][j], t1, Q[k1][i][j], tt); #local j = j+1; #end #local j = 0; #local i = i+1; #end #end #declare tk = vetorK(6); #declare tempo = buscaTempo(clock, 6, tk); #declare A = array[6][5]; #for (i, 0, 5, 1) #for (j, 0, 4, 1) #declare A[i][j] = 0; #end #end #macro desenho() inteporlaQuadros(6, 5, bug, tempo, (tempo+1), tempo/5, (tempo+1)/5 ,clock, A) inseto(A) #end desenho() #include "camlight.inc" #declare centro_cena = < 0, 0, 0 >; #declare raio_cena = 50; #declare dir_camera = < 10.00, 30.00, 5.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)