// Last edited on 2019-07-17 11:30:56 by stolfilocal // Processed by remove-cam-lights 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_vermelho = texture{ pigment{ color rgb < 0.80, 0.10, 0.10 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_pink = texture{ pigment{ color rgb < 0.98, 0.05, 0.75 > } finish{ diffuse 0.8 ambient 0.2 specular 0.5 roughness 0.005 } } #declare tx_orange = texture{ pigment{ color rgb < 0.98, 0.20, 0.20 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.05 } } #declare tx_verde = texture{ pigment{ color rgb < 0.20, 0.90, 0.10 > } 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_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.00, 0.0, 0.00 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 1.0 } #include "eixos.inc" #macro interpolalin(t0, v0, t1, v1, tt) #local r=(tt-t0)/(t1-t0); #local s=1-r; #local vv=s*v0+r*v1; vv #end #macro interpola1matriz(NP, NA, Q, c0, c1, cc, A, k0,k1) #local i=0; #while(i, 0.40 texture{ tx_plastico } } cylinder{ < 0, 0, 0 >, < 0, 2, 0 >, 0.4 texture{ tx_plastico } } } #declare corpo_des = union { sphere{ < 0,0,0 >, 0.40 texture{ tx_plastico } } cylinder{ < 0, 0, 0 >, < 0, 4, 0 >, 0.4 texture{ tx_verde } } } #declare pe_des = union { sphere{ < 0,0,0 >, 0.40 texture{ tx_plastico } } cone{ < 0,0,0>, 0.40, <0,2,0>, 0.00 texture{ tx_plastico } } } #macro pe() object{ pe_des } #end #macro canela(a1,a2) union{ object{ pe() rotate translate <0,2,0> } object{ pe() rotate <-a2,0,0> translate <0,2,0> } object{ canela_des } } #end #macro canela2(a1,a2,b1) union{ object{ canela(a1,a2) rotate translate <0,2,0>} object{ canela_des } } #end #macro perna(a1,a2,b1,b2) union{ object{ canela2(a1,a2,b1) rotate translate <0,2,0>} object{ canela_des } } #end #macro inseto(A,NP,NA) union{ #declare j=0; #for(i,0,(NP-1),1) #if((mod(i, 2)=0)) object{ perna(A[i][0], A[i][1], A[i][2], A[i][3]) rotate translate <0,j*4+4,0>} #else object{ perna(A[i][0], A[i][1], A[i][2], A[i][3]) rotate translate <0,j*4+4,0>} #if(i<(NP-1)) object{ corpo_des translate <0,j*4+4,0> } #end #declare j=j+1; #end #end } #end #macro dragao() #declare NP=6; #declare NA=5; #declare NQ=8; #declare Q=array[NQ][NP][NA] #declare Q[0][0][0]=60; #declare Q[0][0][1]=70; #declare Q[0][0][2]=20; #declare Q[0][0][3]=15; #declare Q[0][0][4]=20; #declare Q[0][1][0]=50; #declare Q[0][1][1]=35; #declare Q[0][1][2]=30; #declare Q[0][1][3]=10; #declare Q[0][1][4]=15; #declare Q[0][2][0]=20; #declare Q[0][2][1]=15; #declare Q[0][2][2]=45; #declare Q[0][2][3]=15; #declare Q[0][2][4]=30; #declare Q[0][3][0]=15; #declare Q[0][3][1]=25; #declare Q[0][3][2]=15; #declare Q[0][3][3]=45; #declare Q[0][3][4]=55; #declare Q[0][4][0]=30; #declare Q[0][4][1]=65; #declare Q[0][4][2]=5; #declare Q[0][4][3]=15; #declare Q[0][4][4]=33; #declare Q[0][5][0]=30; #declare Q[0][5][1]=25; #declare Q[0][5][2]=35; #declare Q[0][5][3]=60; #declare Q[0][5][4]=10; #declare roleta =seed(5); #for(i,1,NQ-2,1) #for(j,0,NP-1,1) #for(k,0,NA-1,1) #local temp = Q[0][j][k]+ rand(roleta)*100; #declare Q[i][j][k]= mod(temp, 45); #end #end #end #declare Q[7][0][0]=60; #declare Q[7][0][1]=70; #declare Q[7][0][2]=20; #declare Q[7][0][3]=15; #declare Q[7][0][4]=20; #declare Q[7][1][0]=50; #declare Q[7][1][1]=35; #declare Q[7][1][2]=30; #declare Q[7][1][3]=10; #declare Q[7][1][4]=15; #declare Q[7][2][0]=20; #declare Q[7][2][1]=15; #declare Q[7][2][2]=45; #declare Q[7][2][3]=15; #declare Q[7][2][4]=30; #declare Q[7][3][0]=15; #declare Q[7][3][1]=25; #declare Q[7][3][2]=15; #declare Q[7][3][3]=45; #declare Q[7][3][4]=55; #declare Q[7][4][0]=30; #declare Q[7][4][1]=65; #declare Q[7][4][2]=5; #declare Q[7][4][3]=15; #declare Q[7][4][4]=33; #declare Q[7][5][0]=30; #declare Q[7][5][1]=25; #declare Q[7][5][2]=35; #declare Q[7][5][3]=60; #declare Q[7][5][4]=10; #declare NK=8; #declare tk=array[NK] #declare tk[0]=0.000; #declare tk[1]=0.100; #declare tk[2]=0.200; #declare tk[3]=0.400; #declare tk[4]=0.500; #declare tk[5]=0.600; #declare tk[6]=0.700; #declare tk[7]=1.000; #declare A=array[NP][NA] #for(i,0,NP-1,1) #for(j,0,NA-1,1) #declare A[i][j]=0; #end #end #local clk=clock; #local k=busca_tempo(clk, NK, tk); interpola1matriz(NP, NA, Q, tk[k], tk[k+1], clk, A, k, k+1) object{ inseto(A, NP, NA) } #end dragao() #include "camlight.inc" #declare centro_cena = < -10.00, 4.00, -5.00>; #declare raio_cena = 11.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 50*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)