// Last edited on 2013-12-11 11:25:25 by stolfilocal // Processed by remove-cam-lights background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_azul = texture{ pigment{ color rgb < 0, 0, 1 > } } #declare tx_vermelho = texture{ pigment{ color rgb < 1,0,0 > } } #declare tx_verde = texture{ pigment{ color rgb < 0,1,0 > } } #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_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.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } #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 SphereLine2(p0,p1,r0,r1,n) union { #declare Index = 0; #while(Index < n) sphere { <0,0,0>, Interpola2(r0,r1,Index/n) translate Interpola2(p0,p1,Index/n) } #declare Index = Index + 1; #end } #end #macro SphereLine4(p0,p1,p2,p3,r0,r1,r2,r3,n) union { #declare Index = 0; #while(Index < n) sphere { <0,0,0>, Interpola4(r0,r1,r2,r3,Index/n) translate Interpola4(p0,p1,p2,p3,Index/n) } #declare Index = Index + 1; #end } #end #macro SphereRing(n,s,r) union { #local p1 = <1,0.5,0> * s; #local p2 = <1,1.5,0> * s; #local q1 = <-1,1.5,0> * s; #local q2 = <-1,0.5,0> * s; #local p0 = (p1 + q2)/2; #local q3 = p0; #local p3 = (p2 + q1)/2; #local q0 = p3; SphereLine4(p0,p1,p2,p3,r,r,r,r,n/2) SphereLine4(q0,q1,q2,q3,r,r,r,r,n/2) } #end #macro Tentacle(pp,rr) #local SIZE = 100; #local p23 = (pp[2]+pp[3])/2; #local r23 = (rr[2]+rr[3])/2; union { SphereLine4(pp[0],pp[1],pp[2],p23,rr[0],rr[1],rr[2],r23,SIZE) SphereLine4(p23,pp[3],pp[4],pp[5],r23,rr[3],rr[4],rr[5],SIZE) } #end #macro AnimatedTentacle(P0,R0,P1,R1,P2,R2,P3,R3,tempo) #local N = 6; #local pos_param = array[N]; #local r_param = array[N]; #local i = 0; #while(i; #declare AnimationMatrix[0][0][1] = <3,0,6>; #declare AnimationMatrix[0][0][2] = <5,0,5>; #declare AnimationMatrix[0][0][3] = <6,0,0>; #declare AnimationMatrix[0][0][4] = <8,0,-3>; #declare AnimationMatrix[0][0][5] = <10,0,-2>; #declare AnimationMatrix[0][1][0] = <2,0,0>; #declare AnimationMatrix[0][1][1] = <3,0,-6>; #declare AnimationMatrix[0][1][2] = <5,0,-5>; #declare AnimationMatrix[0][1][3] = <6,0,0>; #declare AnimationMatrix[0][1][4] = <8,0,3>; #declare AnimationMatrix[0][1][5] = <10,0,2>; ArrayCopy3(AnimationMatrix,AnimationMatrix,np,0,0,0,2) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,0,0,0,4) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,0,0,0,6) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,0,1,0,3) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,0,1,0,5) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,0,1,0,7) #declare AnimationMatrix[1][0][0] = <2,0,-1>; #declare AnimationMatrix[1][0][1] = <3,0,5>; #declare AnimationMatrix[1][0][2] = <5,0,3>; #declare AnimationMatrix[1][0][3] = <6,0,1>; #declare AnimationMatrix[1][0][4] = <8,0,-2>; #declare AnimationMatrix[1][0][5] = <10,0,-1>; #declare AnimationMatrix[1][1][0] = <2,0,1>; #declare AnimationMatrix[1][1][1] = <3,0,-5>; #declare AnimationMatrix[1][1][2] = <5,0,-3>; #declare AnimationMatrix[1][1][3] = <6,0,-1>; #declare AnimationMatrix[1][1][4] = <8,0,2>; #declare AnimationMatrix[1][1][5] = <10,0,1>; ArrayCopy3(AnimationMatrix,AnimationMatrix,np,1,0,1,2) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,1,0,1,4) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,1,0,1,6) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,1,1,1,3) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,1,1,1,5) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,1,1,1,7) #declare AnimationMatrix[2][0][0] = <2,0,-1>; #declare AnimationMatrix[2][0][1] = <3,0,4>; #declare AnimationMatrix[2][0][2] = <5,0,4>; #declare AnimationMatrix[2][0][3] = <6,0,1>; #declare AnimationMatrix[2][0][4] = <8,0,-2>; #declare AnimationMatrix[2][0][5] = <10,0,-1>; #declare AnimationMatrix[2][1][0] = <2,0,1>; #declare AnimationMatrix[2][1][1] = <3,0,-4>; #declare AnimationMatrix[2][1][2] = <5,0,-4>; #declare AnimationMatrix[2][1][3] = <6,0,-1>; #declare AnimationMatrix[2][1][4] = <8,0,2>; #declare AnimationMatrix[2][1][5] = <10,0,1>; ArrayCopy3(AnimationMatrix,AnimationMatrix,np,2,0,2,2) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,2,0,2,4) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,2,0,2,6) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,2,1,2,3) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,2,1,2,5) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,2,1,2,7) #declare AnimationMatrix[nq][0][0] = <2,0,0>; #declare AnimationMatrix[nq][0][1] = <3,0,6>; #declare AnimationMatrix[nq][0][2] = <5,0,5>; #declare AnimationMatrix[nq][0][3] = <6,0,0>; #declare AnimationMatrix[nq][0][4] = <8,0,-3>; #declare AnimationMatrix[nq][0][5] = <10,0,-2>; #declare AnimationMatrix[nq][1][0] = <2,0,0>; #declare AnimationMatrix[nq][1][1] = <3,0,-6>; #declare AnimationMatrix[nq][1][2] = <5,0,-5>; #declare AnimationMatrix[nq][1][3] = <6,0,0>; #declare AnimationMatrix[nq][1][4] = <8,0,3>; #declare AnimationMatrix[nq][1][5] = <10,0,2>; ArrayCopy3(AnimationMatrix,AnimationMatrix,np,nq,0,nq,2) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,nq,0,nq,4) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,nq,0,nq,6) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,nq,1,nq,3) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,nq,1,nq,5) ArrayCopy3(AnimationMatrix,AnimationMatrix,np,nq,1,nq,7) #macro PolvoUmQuadro(ss,ss2,q) union { object { SphereLine2(<0,0,1>,<0,0,12>,2,4,100) rotate<0,0,0>scale texture { tx_azul } } #declare TentacleParams = array[np]; Array2ToArray1(q,TentacleParams,np,0) object { Tentacle(TentacleParams,TentacleRArray) rotate <0,0,0> scale texture { tx_azul } } Array2ToArray1(q,TentacleParams,np,1) object { Tentacle(TentacleParams,TentacleRArray) rotate <0,0,45> scale texture { tx_azul } } Array2ToArray1(q,TentacleParams,np,2) object { Tentacle(TentacleParams,TentacleRArray) rotate <0,0,90> scale texture { tx_azul } } Array2ToArray1(q,TentacleParams,np,3) object { Tentacle(TentacleParams,TentacleRArray) rotate <0,0,135> scale texture { tx_azul } } Array2ToArray1(q,TentacleParams,np,4) object { Tentacle(TentacleParams,TentacleRArray) rotate <0,0,180> scale texture { tx_azul } } Array2ToArray1(q,TentacleParams,np,5) object { Tentacle(TentacleParams,TentacleRArray) rotate <0,0,225> scale texture { tx_azul } } Array2ToArray1(q,TentacleParams,np,6) object { Tentacle(TentacleParams,TentacleRArray) rotate <0,0,270> scale texture { tx_azul } } Array2ToArray1(q,TentacleParams,np,7) object { Tentacle(TentacleParams,TentacleRArray) rotate <0,0,315> scale texture { tx_azul } } } #end #macro Polvo_animado(ss,ss2,tempo) #declare i = 0; #while (DurationArray[i] < tempo & i != nq - 1) #declare i = i + 1; #end #declare i = i - 1; #local tloc = (tempo-DurationArray[i])/(DurationArray[i+1]-DurationArray[i]); #local qtempo = array[nt][np]; #local j = 0; #while (j < nt) #local p = 0; #while (p < np) #local qtempo[j][p] = Interpola2(AnimationMatrix[i][j][p],AnimationMatrix[i+1][j][p],tloc); #local p = p + 1; #end #local j = j + 1; #end union { object { PolvoUmQuadro(1,2,qtempo) } } #end #include "eixos.inc" union{ object { Polvo_animado(1,2,clock) } } #include "camlight.inc" #declare centro_cena = < -0.20, 0.20, 1.00 >; #declare raio_cena = 35.0; #declare dir_camera = < 10.00, 5.00, 7.00 >; #declare dist_camera = 30.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)