// Last edited on 2019-07-17 12:24:55 by stolfilocal // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_cor00 = texture{ pigment{ color rgb < 0.30, 1.00, 0.30 > } finish{ diffuse 0.8 ambient 0.1 specular 1.0 roughness 0.005 } } #declare tx_cor01 = texture{ pigment{ color rgb < 1.00, 0.20, 0.20 > } finish{ diffuse 0.6 ambient 0.1 specular 1.0 roughness 0.005 } } #declare tx_cor02 = texture{ pigment{ color rgb < 0.30, 0.30, 1.00 > } finish{ diffuse 0.5 ambient 0.1 specular 1.0 roughness 0.005 } } #declare rad = 0.2; #declare mosquito_base = union { cylinder{ //corpo < 0, 0, 0 >, < +0.00, +3.00 , +0.00 >, 0.70 texture{tx_cor00} } sphere{ //cabeça < +0.00, +3.00 , +0.00 >, 0.80 texture{tx_cor00} } sphere{ //olho 1 < +0.3, +3.40, +0.00 >, 0.50 texture{tx_cor01} } sphere{ //olho 2 < -0.3, +3.40, +0.00 >, 0.50 texture{tx_cor01} } sphere{ //bunda < 0.00, +0.00, +0.00 >, 0.70 texture{tx_cor00} } cylinder{ //boca < +0.00, +3.80 , -0.20 >, < +0.00, +4.30 , -0.40 >, 0.10 texture{tx_cor00} } } #declare mosquito_parte_perna = union { sphere{ //aticulacao < 0.00, +0.00, +0.00 >, 0.15 texture{tx_cor00} } cylinder{ //parte perna < +0.00, +0.00 , +0.00 >, < +0.00, +0.80 , +0.00 >, 0.15 texture{tx_cor00} } } #macro valor_graus () #local gr = array[6][6][5]; #local gr[0][0][0] = <30, 70, -120>; #local gr[0][0][1] = <-30, 0, 0>; #local gr[0][0][2] = <0, 0,-100>; #local gr[0][0][3] = <0, 0, 10>; #local gr[0][0][4] = <0, 0, 40>; #local gr[0][1][0] = <25, 0, -90>; #local gr[0][1][1] = <30, 0, 0>; #local gr[0][1][2] = <-100, 0, 0>; #local gr[0][1][3] = <-60, 0, 0>; #local gr[0][1][4] = <60, 0, 0>; #local gr[0][2][0] = <40, 0, -40>; #local gr[0][2][1] = <-10, 0, 0>; #local gr[0][2][2] = <-100, 0, 0>; #local gr[0][2][3] = <-20, 0, 0>; #local gr[0][2][4] = <60, 0, 0>; #local gr[0][3][0] = <30, 70, -120>; #local gr[0][3][1] = <-30, 0, 0>; #local gr[0][3][2] = <0, 0,-100>; #local gr[0][3][3] = <0, 0, 10>; #local gr[0][3][4] = <0, 0, 40>; #local gr[0][4][0] = <25, 0, -90>; #local gr[0][4][1] = <30, 0, 0>; #local gr[0][4][2] = <-100, 0, 0>; #local gr[0][4][3] = <-60, 0, 0>; #local gr[0][4][4] = <60, 0, 0>; #local gr[0][5][0] = <40, 0, -40>; #local gr[0][5][1] = <-10, 0, 0>; #local gr[0][5][2] = <-100, 0, 0>; #local gr[0][5][3] = <-20, 0, 0>; #local gr[0][5][4] = <60, 0, 0>; #local gr[1][0][0] = <30, 70, -120>; #local gr[1][0][1] = <-60, 0, 0>; #local gr[1][0][2] = <0, 0,-100>; #local gr[1][0][3] = <0, 0, 10>; #local gr[1][0][4] = <0, 0, 40>; #local gr[1][1][0] = <25, 0, -40>; #local gr[1][1][1] = <30, 0, 0>; #local gr[1][1][2] = <-100, 0, 0>; #local gr[1][1][3] = <-60, 0, 0>; #local gr[1][1][4] = <60, 0, 0>; #local gr[1][2][0] = <-10, 0, -30>; #local gr[1][2][1] = <-20, 0, 0>; #local gr[1][2][2] = <-10, 0, 0>; #local gr[1][2][3] = <-20, 0, 0>; #local gr[1][2][4] = <40, 0, 0>; #local gr[1][3][0] = <30, 70, -120>; #local gr[1][3][1] = <-60, 0, 0>; #local gr[1][3][2] = <0, 0,-100>; #local gr[1][3][3] = <0, 0, 10>; #local gr[1][3][4] = <0, 0, 40>; #local gr[1][4][0] = <25, 0, -130>; #local gr[1][4][1] = <30, 0, 0>; #local gr[1][4][2] = <-100, 0, 0>; #local gr[1][4][3] = <-60, 0, 0>; #local gr[1][4][4] = <60, 0, 0>; #local gr[1][5][0] = <-10, 0, -30>; #local gr[1][5][1] = <-20, 0, 0>; #local gr[1][5][2] = <-10, 0, 0>; #local gr[1][5][3] = <-20, 0, 0>; #local gr[1][5][4] = <40, 0, 0>; #local gr[2][0][0] = <30, 70, -120>; #local gr[2][0][1] = <10, 0, -40>; #local gr[2][0][2] = <0, 0,-20>; #local gr[2][0][3] = <0, 0, 10>; #local gr[2][0][4] = <0, 0, 10>; #local gr[2][1][0] = <25, 0, -90>; #local gr[2][1][1] = <30, 0, 0>; #local gr[2][1][2] = <-100, 0, 0>; #local gr[2][1][3] = <-60, 0, 0>; #local gr[2][1][4] = <60, 0, 0>; #local gr[2][2][0] = <40, 0, -40>; #local gr[2][2][1] = <-10, 0, 0>; #local gr[2][2][2] = <-100, 0, 0>; #local gr[2][2][3] = <-20, 0, 0>; #local gr[2][2][4] = <60, 0, 0>; #local gr[2][3][0] = <30, 70, -120>; #local gr[2][3][1] = <10, 0, -40>; #local gr[2][3][2] = <0, 0,-20>; #local gr[2][3][3] = <0, 0, 10>; #local gr[2][3][4] = <0, 0, 10>; #local gr[2][4][0] = <25, 0, -90>; #local gr[2][4][1] = <30, 0, 0>; #local gr[2][4][2] = <-100, 0, 0>; #local gr[2][4][3] = <-60, 0, 0>; #local gr[2][4][4] = <60, 0, 0>; #local gr[2][5][0] = <40, 0, -40>; #local gr[2][5][1] = <-10, 0, 0>; #local gr[2][5][2] = <-100, 0, 0>; #local gr[2][5][3] = <-20, 0, 0>; #local gr[2][5][4] = <60, 0, 0>; #local gr[3][0][0] = <30, 70, -60>; #local gr[3][0][1] = <40, 0, -90>; #local gr[3][0][2] = <0, 0,-20>; #local gr[3][0][3] = <0, 0, 50>; #local gr[3][0][4] = <0, 0, 30>; #local gr[3][1][0] = <25, 0, -130>; #local gr[3][1][1] = <30, 0, 0>; #local gr[3][1][2] = <-100, 0, 0>; #local gr[3][1][3] = <-60, 0, 0>; #local gr[3][1][4] = <60, 0, 0>; #local gr[3][2][0] = <40, 0, -40>; #local gr[3][2][1] = <20, 0, 0>; #local gr[3][2][2] = <-150, 0, 0>; #local gr[3][2][3] = <-10, 0, 0>; #local gr[3][2][4] = <60, 0, 0>; #local gr[3][3][0] = <30, 70, -40>; #local gr[3][3][1] = <40, 0, -90>; #local gr[3][3][2] = <0, 0,-20>; #local gr[3][3][3] = <0, 0, 60>; #local gr[3][3][4] = <0, 0, 20>; #local gr[3][4][0] = <25, 0, -40>; #local gr[3][4][1] = <10, 0, 0>; #local gr[3][4][2] = <-60, 0, 0>; #local gr[3][4][3] = <-50, 0, 0>; #local gr[3][4][4] = <60, 0, 0>; #local gr[3][5][0] = <40, 0, -40>; #local gr[3][5][1] = <20, 0, 0>; #local gr[3][5][2] = <-150, 0, 0>; #local gr[3][5][3] = <-10, 0, 0>; #local gr[3][5][4] = <60, 0, 0>; #local gr[4][0][0] = <30, 40, -60>; #local gr[4][0][1] = <0, 0, -90>; #local gr[4][0][2] = <0, 0,-20>; #local gr[4][0][3] = <0, 0, 50>; #local gr[4][0][4] = <0, 0, 30>; #local gr[4][1][0] = <35, 0, -90>; #local gr[4][1][1] = <10, 0, 0>; #local gr[4][1][2] = <-110, 0, 0>; #local gr[4][1][3] = <-50, 0, 0>; #local gr[4][1][4] = <50, 0, 0>; #local gr[4][2][0] = <40, 0, -40>; #local gr[4][2][1] = <-10, 0, 0>; #local gr[4][2][2] = <-80, 0, 0>; #local gr[4][2][3] = <10, 0, 0>; #local gr[4][2][4] = <45, 0, 0>; #local gr[4][3][0] = <30, 40, -60>; #local gr[4][3][1] = <0, 0, -90>; #local gr[4][3][2] = <0, 0,-20>; #local gr[4][3][3] = <0, 0, 60>; #local gr[4][3][4] = <0, 0, 20>; #local gr[4][4][0] = <35, 0, -90>; #local gr[4][4][1] = <10, 0, 0>; #local gr[4][4][2] = <-110, 0, 0>; #local gr[4][4][3] = <-50, 0, 0>; #local gr[4][4][4] = <50, 0, 0>; #local gr[4][5][0] = <40, 0, -40>; #local gr[4][5][1] = <-10, 0, 0>; #local gr[4][5][2] = <-80, 0, 0>; #local gr[4][5][3] = <10, 0, 0>; #local gr[4][5][4] = <40, 0, 0>; #local gr[5][0][0] = <30, 70, -120>; #local gr[5][0][1] = <-30, 0, 0>; #local gr[5][0][2] = <0, 0,-100>; #local gr[5][0][3] = <0, 0, 10>; #local gr[5][0][4] = <0, 0, 40>; #local gr[5][1][0] = <25, 0, -90>; #local gr[5][1][1] = <30, 0, 0>; #local gr[5][1][2] = <-100, 0, 0>; #local gr[5][1][3] = <-60, 0, 0>; #local gr[5][1][4] = <60, 0, 0>; #local gr[5][2][0] = <40, 0, -40>; #local gr[5][2][1] = <-10, 0, 0>; #local gr[5][2][2] = <-100, 0, 0>; #local gr[5][2][3] = <-20, 0, 0>; #local gr[5][2][4] = <60, 0, 0>; #local gr[5][3][0] = <30, 70, -120>; #local gr[5][3][1] = <-30, 0, 0>; #local gr[5][3][2] = <0, 0,-100>; #local gr[5][3][3] = <0, 0, 10>; #local gr[5][3][4] = <0, 0, 40>; #local gr[5][4][0] = <25, 0, -90>; #local gr[5][4][1] = <30, 0, 0>; #local gr[5][4][2] = <-100, 0, 0>; #local gr[5][4][3] = <-60, 0, 0>; #local gr[5][4][4] = <60, 0, 0>; #local gr[5][5][0] = <40, 0, -40>; #local gr[5][5][1] = <-10, 0, 0>; #local gr[5][5][2] = <-100, 0, 0>; #local gr[5][5][3] = <-20, 0, 0>; #local gr[5][5][4] = <60, 0, 0>; gr #end #macro valor_tk () #local tk = array[6]; #local tk[0] = 0.0; #local tk[1] = 0.3; #local tk[2] = 0.5; #local tk[3] = 0.7; #local tk[4] = 0.9; #local tk[5] = 1.0; tk #end #macro find_tk (c, tk, NK) #local i = 0; #local res = NK-2; #while (i < NK-2) #if (c >= tk[i]) #if (c < tk[i+1]) #local res = i; #end #end #local i = i+1; #end res #end #macro interpola (t0, v0, t1, v1, tt) #local r = (tt-t0)/(t1-t0); #local s = 1-r; #local vv = s*v0 + r*v1; vv #end #macro interpola_matrix (P, NP, NA, t0, t1, c0, c1, cc, R) #local i = 0; #while (i < NP) #local j = 0; #while (j < NA) #local R[i][j] = interpola (c0, P[t0][i][j], c1, P[t1][i][j], cc); #local j = j+1; #end #local i = i+1; #end #end #macro mosquito (graus, t_parte, t_perna, tk, nt, clk) union { #local R = array [6][5]; interpola_matrix (graus, 6, 5, nt, nt+1, tk[nt], tk[nt+1], clk, R) object{perna_1 (R, 0, t_parte) translate t_perna} object{perna_1 (R, 1, t_parte) translate t_perna+<0,1,0>} object{perna_1 (R, 2, t_parte) translate t_perna+<0,2,0>} object{perna_1 (R, 3, t_parte) translate t_perna scale<-1, 1, 1>} object{perna_1 (R, 4, t_parte) translate t_perna+<0,1,0> scale<-1, 1, 1>} object{perna_1 (R, 5, t_parte) translate t_perna+<0,2,0> scale<-1, 1, 1>} object{mosquito_base} } #end #macro perna_1 (graus, i, tt) union { #local new_graus = array[4]; #local new_graus[0] = graus[i][1]; #local new_graus[1] = graus[i][2]; #local new_graus[2] = graus[i][3]; #local new_graus[3] = graus[i][4]; object{perna_2 (new_graus, tt) translate tt} object{mosquito_parte_perna} rotate graus[i][0] } #end #macro perna_2 (graus, tt) union { #local new_graus = array[3]; #local new_graus[0] = graus[1]; #local new_graus[1] = graus[2]; #local new_graus[2] = graus[3]; object{perna_3 (new_graus, tt) translate tt} object{mosquito_parte_perna} rotate graus[0] } #end #macro perna_3 (graus, tt) union { #local new_graus = array[2]; #local new_graus[0] = graus[1]; #local new_graus[1] = graus[2]; object{perna_4 (new_graus, tt) translate tt} object{mosquito_parte_perna} rotate graus[0] } #end #macro perna_4 (graus, tt) union { object{perna_5 (graus[1]) translate tt} object{mosquito_parte_perna} rotate graus[0] } #end #macro perna_5 (alfa) object{mosquito_parte_perna rotate alfa } #end #include "eixos.inc" // object{ eixos(3.00) } #declare modelo = valor_graus (); #declare tk = valor_tk(); #declare nt = find_tk(clock, tk, 6); object{mosquito (modelo, < +0.00, +0.80 , +0.00 >, <0.7, 0.0, 0.0>, tk, nt, clock) } #include "camlight.inc" #declare centro_cena = < 0, 2, -0.5 >; #declare raio_cena = 6.0; #declare dir_camera = < 10.00, 10.00, 10.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)