// Last edited on DATE TIME by USER // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_red = texture{ pigment{ color rgb < 1, 0, 0 > } finish{ diffuse 0.8 ambient 0.2 specular 0.5 roughness 0.005 } } #declare tx_green = texture{ pigment{ color rgb < 0, 1, 0 > } finish{ diffuse 0.8 ambient 0.2 specular 0.5 roughness 0.005 } } #declare tx_blue = texture{ pigment{ color rgb < 0, 0, 1 > } finish{ diffuse 0.8 ambient 0.2 specular 0.5 roughness 0.005 } } #declare tx_lightbrown = texture{ pigment{ color rgb < 1.11, 0.59, 0.59 > } finish{ diffuse 0.5 ambient 0.2 specular 0.5 roughness 0.005 } } #declare tx_brown = texture{ pigment{ color rgb < 1.11, 0.59, 0.59 > } finish{ diffuse 0.4 ambient 0.2 specular 0.5 roughness 0.005 } } #declare tx_lightorange = texture{ pigment{ color rgb < 1, 0.5, 0 > } finish{ diffuse 0.8 ambient 0.2 specular 0.5 roughness 0.005 } } #declare tx_orange = texture{ pigment{ color rgb < 1, 0.5, 0 > } finish{ diffuse 0.5 ambient 0.2 specular 0.5 roughness 0.005 } } #declare tx_black = texture{ pigment{ color rgb < 0.2, 0.2, 0.2 > } finish{ diffuse 0.8 ambient 0.2 specular 0.5 roughness 0.005 } } #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_espelho = texture{ pigment{ color rgb < 1.00, 0.50, 0.50 > } finish{ diffuse 0.4 reflection 0.5*< 1.00, 1.00, 1.00 > ambient 0.1 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 1.0, 1.0, 1.0 >, color rgb < 0.0, 0.0, 0.0 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.5 } #declare raio = 0.3; #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #macro bolinha(rr) sphere { <0,0,0> rr texture{tx_lightbrown} } #end #macro Interpola2(P0, P1, tt) (1-tt)*P0 + tt*P1 #end #macro Interpola4(P0, P1, P2, P3, tt) #local P01 = Interpola2(P0, P1, tt); #local P12 = Interpola2(P1, P2, tt); #local P23 = Interpola2(P2, P3, tt); #local P012 = Interpola2(P01, P12, tt); #local P123 = Interpola2(P12, P23, tt); Interpola2(P012, P123, tt) #end #macro curva(P0, P1, P2, P3, R0, R1, R2, R3) #local i = 0; #local param = 0.01; #while (i < 100) object{bolinha(Interpola4(R0, R1, R2, R3, param)) translate Interpola4(P0,P1, P2, P3, param)} #local i = i + 1; #local param = param + 0.01; #end #end #macro tentaculo(P0, P1, P2, P3, P4, P5, P6, P7) #local R0 = 0.22; #local R1 = 0.20; #local R2 = 0.18; #local R3 = 0.16; union{ curva(P0, P1, P2, P3, R0, (R0+R1/2), (R0+R1/2), R1) curva(P4, P5, P6, P7, R1, (R2+R3)/2, (R2+R3)/2, R3) } #end #declare nq = 2; // numero de quadros #declare nt = 1; // numero de tentaculos #declare np = 8; // numero de parametros p/ cada tentaculo #declare d = array[nq+1]; // instante cada quadro #declare q = array[nq][nt][np]; // matriz quadros ; todo: nq+1 #declare d[0] = 0; #declare d[1] = 1; #declare P = array[nq][np]; #macro constroi_parametros() #local i = 0; #local k = 0; #while (i < nq) #declare P[i][0] = <0 - k, 0, 0 + k>; #declare P[i][1] = <1.5 - k, 0, 0.5 + k>; #declare P[i][2] = <2 - k, 0, 0.5 + k>; #declare P[i][5] = <2.5 - k, 0, -0.5 + k>; #declare P[i][6] = <3 - k, 0, -0.5 + k>; #declare P[i][7] = <3.5 - k, 0, 0 + k>; #declare P[i][3] = (P[i][2] + P[i][5])/2; #declare P[i][4] = P[i][3]; #local k = k + 0.1; #local i = i + 1; #end #end #macro polvo_quadro (quadro,tentaculo) #local i = 0; #while (i < np) #declare q[quadro][tentaculo][i] = P[quadro][i]; #local i = i + 1; #end #end #macro polvo_animado2(tempo) #local i = 0; #while (d[i] > tempo | d[i+1] < tempo)) #local i = i + 1; #end #local tloc = (tempo - d[i]) / (d[i+1] - d[i]); #local q_tempo = array[nt][np]; #local j = 0; #while (j < nt) #local p = 0; #while (p < np) #local q_tempo[j][p] = Interpola2(q[i][j][p], q[i+1][j][p], tloc); #local p = p+1; #end #local j = j + 1; #end union{ object{ tentaculo( q_tempo[0][0], q_tempo[0][1], q_tempo[0][2], q_tempo[0][3], q_tempo[0][4], q_tempo[0][5], q_tempo[0][6], q_tempo[0][7]) } } #end #macro polvo_animado() union{ object{sphere{<0,0,0>, 1 texture{tx_brown}}} object{tentaculo_animado(P0, P1, P2, P3, Q0, Q1, Q2, Q3) translate <1.05, 0, 0>} object{tentaculo_animado(P0, P1, P2, P3, Q0, Q1, Q2, Q3) scale -1 translate<-1.05, 0, 0>} object{tentaculo_animado(P0, P1, P2, P3, Q0, Q1, Q2, Q3) scale -1 translate<-1.05, 0, 0> rotate<0,0,45>} object{tentaculo_animado(P0, P1, P2, P3, Q0, Q1, Q2, Q3) scale -1 translate<-1.05, 0, 0> rotate<0,0,-45>} object{tentaculo_animado(P0, P1, P2, P3, Q0, Q1, Q2, Q3) scale -1 translate<-1.05, 0, 0> rotate<0,0,90>} object{tentaculo_animado(P0, P1, P2, P3, Q0, Q1, Q2, Q3) translate <1.05, 0, 0> rotate <0,0,45>} object{tentaculo_animado(P0, P1, P2, P3, Q0, Q1, Q2, Q3) translate <1.05, 0, 0> rotate <0,0,-45>} object{tentaculo_animado(P0, P1, P2, P3, Q0, Q1, Q2, Q3) translate <1.05, 0, 0> rotate <0,0,90>} } #end #include "eixos.inc" union{ object{ eixos(20.00)} object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } constroi_parametros() polvo_quadro(0,0) polvo_quadro(1,0) polvo_animado2(clock) } #include "camlight.inc" #declare centro_cena = < -0.2, 0.200, 1 >; #declare raio_cena = 6.0; #declare dir_camera = < 2, 3, 2>; #declare dist_camera = 16; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)