// Last edited on 2013-12-11 11:24:05 by stolfilocal // Processed by remove-cam-lights #include "textures.inc" #include"math.inc" 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 < 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_verde = texture{ pigment{ color rgb < 0, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_creme = texture{ pigment{ color rgb < 0.9, 1, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } } #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 } #declare tx_branco= texture{ pigment{ color rgb <1,1,1>} finish {diffuse 0.9 ambient 0.1} } #macro polvo_quadro(p,p1) object { polvo_vetor(p,p1) } #end #macro tentaculo_animado_vetor(p,p1) union{ #while(p1[7]<=1.0) #if(clock<=0.500) object { sphere { <0,0,0>, Interpola4(p1[0],p1[1],p1[2],p1[3],p1[7])} translate Interpola4(p[0]*clock,p[1]*(1-clock),p[2]*clock,p[3],p1[7])} object { sphere { <0,0,0>, Interpola4(p1[3],p1[4],p1[5],p1[6],p1[7])} translate Interpola4(p[3],p[4]*clock,p[5]*(1-clock),p[6]*clock, p1[7])} #end #if(clock>0.500) object { sphere { <0,0,0>, Interpola4(p1[0],p1[1],p1[2],p1[3],p1[7])} translate Interpola4(p[0]*(1-clock),p[1]*clock,p[2]**(1-clock),p[3],p1[7])} object { sphere { <0,0,0>, Interpola4(p1[3],p1[4],p1[5],p1[6],p1[7])} translate Interpola4(p[3],p[4]*(1-clock),p[5]*clock,p[6]*(1-clock), p1[7])} #end #declare p1[7] = p1[7] + 0.001; #end } #end #macro polvo_vetor(p,p1) union{ #declare p1[7] = 0.0; object{ tentaculo_animado_vetor(p,p1) translate<0,1,0> texture {tx_plastico}} #declare p1[7] = 0.0; object{ tentaculo_animado_vetor(p,p1) rotate<0,0,90> translate<-1,0,0> texture {tx_plastico}} #declare p1[7] = 0.0; object{ tentaculo_animado_vetor(p,p1) rotate<0,0,180> translate<0,-1,0> texture {tx_plastico}} #declare p1[7] = 0.0; object{ tentaculo_animado_vetor(p,p1) rotate<0,0,270> translate<1,0,0> texture {tx_plastico}} #declare p1[7] = 0.0; object{ tentaculo_animado_vetor(p,p1) rotate<0,0,45> translate<-0.5,0.5,0> texture {tx_plastico}} #declare p1[7] = 0.0; object{ tentaculo_animado_vetor(p,p1) rotate<0,0,135> translate<-0.5,-0.5,0> texture {tx_plastico}} #declare p1[7] = 0.0; object{ tentaculo_animado_vetor(p,p1) rotate<0,0,225> translate<0.5,-0.5,0> texture {tx_plastico}} #declare p1[7] = 0.0; object{ tentaculo_animado_vetor(p,p1) rotate<0,0,315> translate<0.5,0.5,0> texture {tx_plastico}} object{ sphere { <0,0,0>, 1} scale <1,1.5,2.5> translate <0,0,1> texture {tx_vidro}} } #end #declare raio = 2.000; #declare bolota = sphere{ < 0,0,0 >, 0.05 } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #macro Interpola(p0,p1,tt) ((1-tt)*p0 + tt*p1) #end #declare p0 = <0.0,0.0,0.0>; #declare p1 = <0.0,0.5,1.0>; #declare p2 = <0.0,1.0,-1.0>; #declare p4 = <0.0,2.0,1.5>; #declare p3 = (p2+p4)/2; #declare p5 = <0.0,2.5,2>; #declare p6 = <0.0,3,-2>; #declare tt = 0.0; #declare r0 = 0.25; #declare r1 = 0.20; #declare r2 = 0.15; #declare r3 = 0.10; #declare r4 = 0.08; #declare r5 = 0.05; #declare r6 = 0.02; #macro Interpola4(p0,p1,p2,p3,tt) #local p01 = Interpola(p0,p1,tt); #local p12 = Interpola(p1,p2,tt); #local p23 = Interpola(p2,p3,tt); #local p012 = Interpola(p01,p12,tt); #local p123 = Interpola(p12,p23,tt); #local p0123 = Interpola(p012,p123,tt); p0123 #end #macro curva(p0,p1,p2,p3,tt) union{ #while(tt<=1.0) object { bolota translate Interpola4(p0, p1, p2, p3, tt)} #declare tt = tt + 0.001; #end } #end #macro curva_raios(p0,r0,p1,r1,p2,r2,p3,r3,tt) union{ #while(tt<=1.0) object { sphere { <0,0,0>, Interpola4(r0,r1,r2,r3,tt)} translate Interpola4(p0,p1,p2,p3,tt)} #declare tt = tt + 0.001; #end } #end #macro tentaculo(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt) union{ #while(tt<=1.0) object { sphere { <0,0,0>, Interpola4(r0,r1,r2,r3,tt)} translate Interpola4(p0,p1,p2,p3,tt)} object { sphere { <0,0,0>, Interpola4(r3,r4,r5,r6,tt)} translate Interpola4(p3,p4,p5,p6,tt)} #declare tt = tt + 0.001; #end } #end #macro tentaculo_animado(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt) union{ #while(tt<=1.0) #if(clock<=0.500) object { sphere { <0,0,0>, Interpola4(r0,r1,r2,r3,tt)} translate Interpola4(p0*clock,p1*(1-clock),p2*clock,p3,tt)} object { sphere { <0,0,0>, Interpola4(r3,r4,r5,r6,tt)} translate Interpola4(p3,p4*clock,p5*(1-clock),p6*clock,tt)} #end #if(clock>0.500) object { sphere { <0,0,0>, Interpola4(r0,r1,r2,r3,tt)} translate Interpola4(p0*(1-clock),p1*clock,p2*(1-clock),p3,tt)} object { sphere { <0,0,0>, Interpola4(r3,r4,r5,r6,tt)} translate Interpola4(p3,p4*(1-clock),p5*clock,p6*(1-clock),tt)} #end #declare tt = tt + 0.001; #end } #end #macro polvo(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt) union{ #declare tt = 0.0; object{ tentaculo_animado(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt) translate<0,1,0> texture {tx_plastico}} #declare tt = 0.0; object{ tentaculo_animado(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt) rotate<0,0,90> translate<-1,0,0> texture {tx_plastico}} #declare tt = 0.0; object{ tentaculo_animado(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt) rotate<0,0,180> translate<0,-1,0> texture {tx_plastico}} #declare tt = 0.0; object{ tentaculo_animado(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt) rotate<0,0,270> translate<1,0,0> texture {tx_plastico}} #declare tt = 0.0; object{ tentaculo_animado(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt) rotate<0,0,45> translate<-0.5,0.5,0> texture {tx_plastico}} #declare tt = 0.0; object{ tentaculo_animado(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt) rotate<0,0,135> translate<-0.5,-0.5,0> texture {tx_plastico}} #declare tt = 0.0; object{ tentaculo_animado(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt) rotate<0,0,225> translate<0.5,-0.5,0> texture {tx_plastico}} #declare tt = 0.0; object{ tentaculo_animado(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt) rotate<0,0,315> translate<0.5,0.5,0> texture {tx_plastico}} object{ sphere { <0,0,0>, 1} scale <1,1.5,2.5> translate <0,0,1> texture {tx_vidro}} } #end #include "eixos.inc" union{ #declare ponto = array[3][7]; #declare ponto2 = array[3][8]; object{ eixos(3.00)} object{ chao translate < 0,0,-5 > texture{ tx_xadrez }} #declare ponto[0][0] = p0; #declare ponto[0][1] = p1; #declare ponto[0][2] = p2; #declare ponto[0][3] = p3; #declare ponto[0][4] = p4; #declare ponto[0][5] = p5; #declare ponto[0][6] = p6; #declare ponto2[0][0] = r0; #declare ponto2[0][1] = r1; #declare ponto2[0][2] = r2; #declare ponto2[0][3] = r3; #declare ponto2[0][4] = r4; #declare ponto2[0][5] = r5; #declare ponto2[0][6] = r6; #declare ponto2[0][7] = tt; #declare ponto[1][0] = p0; #declare ponto[1][1] = p1; #declare ponto[1][2] = p2; #declare ponto[1][3] = p3; #declare ponto[1][4] = p4; #declare ponto[1][5] = p5; #declare ponto[1][6] = p6; #declare ponto2[1][0] = r0; #declare ponto2[1][1] = r1; #declare ponto2[1][2] = r2; #declare ponto2[1][3] = r3; #declare ponto2[1][4] = r4; #declare ponto2[1][5] = r5; #declare ponto2[1][6] = r6; #declare ponto2[1][7] = tt; #declare ponto[2][0] = p0; #declare ponto[2][1] = p1; #declare ponto[2][2] = p2; #declare ponto[2][3] = p3; #declare ponto[2][4] = p4; #declare ponto[2][5] = p5; #declare ponto[2][6] = p6; #declare ponto2[2][0] = r0; #declare ponto2[2][1] = r1; #declare ponto2[2][2] = r2; #declare ponto2[2][3] = r3; #declare ponto2[2][4] = r4; #declare ponto2[2][5] = r5; #declare ponto2[2][6] = r6; #declare ponto2[2][7] = tt; object{polvo(p0,p1,p2,p3,p4,p5,p6,r0,r1,r2,r3,r4,r5,r6,tt)} } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 8.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)