// 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 = 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 < 0.54, 0.80, 0.10 > } 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 } } // ====================================================================== // Seed #declare roleta = seed(342); // ====================================================================== // DESCRI��O DA CENA #include "eixos.inc" // percorre o array e interpola os pontos #macro interpola1_array(n,tt,tt0, tt1, P0, P1) #local rr = (tt - tt0)/(tt1 - tt0); #local qd = array[n]; #local j = 0; #while (j < n) #local qd[j] = (1-rr)*P0[j] + rr*P1[j]; #local j = j+1; #end qd #end // não utilizada //#macro paraminterpola3(tt, tt0,tt3, vv0,vv1,vv2,vv3) // #local vv01 = interpola1_array(tt, tt0,tt3, vv0,vv1); // #local vv12 = interpola1_array(tt, tt0,tt3, vv1,vv2); // #local vv23 = interpola1_array(tt, tt0,tt3, vv2,vv3); // #local vv012 = interpola1_array(tt, tt0,tt3, vv01,vv12); // #local vv123 = interpola1_array(tt, tt0,tt3, vv12,vv23); // #local vv0123 = interpola1_array(tt, tt0,tt3, vv012,vv123); // vv0123 //#end // interpola coordenadas #macro interpola1(tt,tt0, tt1, P0, P1) #local rr = (tt - tt0)/(tt1 - tt0); #local qd = (1-rr)*P0 + rr*P1; qd #end #macro interpola3(tt, tt0,tt3, vv0,vv1,vv2,vv3) #local vv01 = interpola1(tt, tt0,tt3, vv0,vv1); #local vv12 = interpola1(tt, tt0,tt3, vv1,vv2); #local vv23 = interpola1(tt, tt0,tt3, vv2,vv3); #local vv012 = interpola1(tt, tt0,tt3, vv01,vv12); #local vv123 = interpola1(tt, tt0,tt3, vv12,vv23); #local vv0123 = interpola1(tt, tt0,tt3, vv012,vv123); vv0123 #end #macro segtaculo(M,P0,R0,P1,R1,P2,R2,P3,R3) #local tt = 0; #while (tt < M) #local centro = interpola3(tt,0,M,P0,P1,P2,P3); #local raio = interpola3(tt,0,M,R0,R1,R2,R3); object{sphere{centro, raio texture{tx_plastico}}} #local tt = tt + 1; #end #end #macro tentaculo(M,N,PP,RR) #local i = 0; #while(i; #local PP0[1] = <0, 0, 5>; #local PP0[2] = <0, 0, 10>; #local PP0[3] = <0, 0, 20>; #local PP0[4] = <0, 0, 25>; #local PP0[5] = <0, 0, 35>; #local PP0[6] = <0, 0, 40>; #local PP0[7] = <0, 0, 50>; #local PP0[8] = <0, 0, 55>; #local PP0[9] = <0, 0, 60>; #local PP1[0] = <0, 0, 0>; #local PP1[1] = <0, 0, 5>; #local PP1[2] = <0, 0, 10>; #local PP1[3] = <0, 10, 20>; #local PP1[4] = <0, 10, 25>; #local PP1[5] = <0, 25, 35>; #local PP1[6] = <0, 30, 40>; #local PP1[7] = <0, 35, 50>; #local PP1[8] = <0, 40, 55>; #local PP1[9] = <0, 45, 50>; #local PP2[0] = <0,0,0>; #local PP2[1] = <0,5,5>; #local PP2[2] = <0,10,10>; #local PP2[3] = <0,20,20>; #local PP2[4] = <0,40,25>; #local PP2[5] = <0,40,35>; #local PP2[6] = <0,40,40>; #local PP2[7] = <0,40,50>; #local PP2[8] = <0,40,55>; #local PP2[9] = <0,40,60>; #local PP3[0] = <0,0,0>; #local PP3[1] = <0,0,5>; #local PP3[2] = <0,0,10>; #local PP3[3] = <0,0,20>; #local PP3[4] = <0,0,25>; #local PP3[5] = <0,0,35>; #local PP3[6] = <0,0,40>; #local PP3[7] = <0,0,50>; #local PP3[8] = <0,0,55>; #local PP3[9] = <0,0,60>; #local RR0[0] = 5; #local RR0[1] = 6; #local RR0[2] = 7; #local RR0[3] = 5; #local RR0[4] = 4; #local RR0[5] = 3; #local RR0[6] = 3; #local RR0[7] = 2; #local RR0[8] = 2; #local RR0[9] = 1; #local RR1[0] = 5; #local RR1[1] = 6; #local RR1[2] = 7; #local RR1[3] = 5; #local RR1[4] = 4; #local RR1[5] = 3; #local RR1[6] = 3; #local RR1[7] = 2; #local RR1[8] = 2; #local RR1[9] = 1; #local RR2[0] = 5; #local RR2[1] = 5; #local RR2[2] = 5; #local RR2[3] = 4.5; #local RR2[4] = 4; #local RR2[5] = 3.5; #local RR2[6] = 3; #local RR2[7] = 2; #local RR2[8] = 1.5; #local RR2[9] = 1; #local RR3[0] = 5; #local RR3[1] = 6; #local RR3[2] = 7; #local RR3[3] = 5; #local RR3[4] = 4; #local RR3[5] = 3; #local RR3[6] = 3; #local RR3[7] = 2; #local RR3[8] = 2; #local RR3[9] = 1; // interpola os frames entre keys #if((T0 <= tf) & (tf < T1)) #local P = interpola1_array(10,tf, T0,T1,PP0, PP1 ); #local q = interpola1_array(10,tf, T0,T1,RR0, RR1 ); #elseif ((T1 <= tf) & (tf < T2)) #local P = interpola1_array(10,tf, T1,T2,PP1, PP2 ); #local q = interpola1_array(10,tf, T1,T2,RR1, RR2 ); #elseif ((T2 <= tf) & (tf <= T3)) #local P = interpola1_array(10,tf, T2,T3,PP2, PP3 ); #local q = interpola1_array(10,tf, T2,T3,RR2, RR3 ); #end #local QPP = interpola_tentaculo(P); #local QRR = interpola_tentaculo(RR2); union{tentaculo(M,N,QPP,QRR)} #end union { object{tentaculo_animado(100, clock)} object{eixos(40)} } #include "camlight.inc" #declare centro_cena = < 0, 0, 0 >; #declare raio_cena = 60; #declare dir_camera = < 1, 1, 2 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)