// Last edited on 2013-12-11 11:16:44 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_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
}
#declare chao =
box{ <-20,-20,-1>, <+20,+20,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);
#local P0123 = interpola2(P012,P123,tt);
P0123
#end
#declare ptent1 = array[4] {<0,0,0>,<1,1,1>,<2,2,-1>,<3,3,0.5>}
#declare t1c1 = array[3] {<0.5,0.5,0>,<1,1,0.5>,<1.5,1.5,0.5>}
#declare t1c2 = array[3] {<2.5,2.5,-0.5>,<3,3,-0.5>,<3.5,3.5,0>}
#declare t2c1 = array[3] {<-0.5,0.5,0>,<-1,1,0.5>,<-2,2,0.5>}
#declare t2c2 = array[3] {<-2.5,2.5,-0.5>,<-3,3,-0.5>,<-3.5,3.5,0.5>}
#declare t3c1 = array[3] {<-0.5,-0.5,0>,<-0.5,-0.5,0.5>,<-1,-1,0.5>}
#declare t3c2 = array[3] {<-2.5,-2.5,-0.5>,<-3,-3,-0.5>,<-3.5,-3.5,0>}
#declare t1ai = array[18] {0.5,0.5,0,1,1,0.5,1.5,1.5,0.5,2.5,2.5,-0.5,3,3,-0.5,3.5,3.5,0}
#declare t1am1 = array[18] {0.5,0.5,0,1,1,0.3,1.5,1.5,0.1,2.5,2.5,-0.1,3,3,-0.3,3.5,3.5,0.5}
#declare t1am2 = array[18] {0.5,0.5,0,1,1,-0.3,1.5,1.5,-0.3,2.5,2.5,0.3,3,3,0.3,3.5,3.5,-0.5}
#declare t1af = t1ai;
#macro curva_raio(P0,P1,P2,P3,R0,R1,R2,R3,N)
union {
#local i = 0;
#while (i <= N )
#local centro = interpola4(P0,P1,P2,P3, i/N);
#local raio = interpola4(R0,R1,R2,R3,i/N);
object { sphere { centro, raio} texture {tx_plastico }}
#local i = i + 1;
#end
}
#end
#macro curva(P0,P1,P2,P3,N)
union {
#local i = 0;
#while (i <= N )
object { sphere { interpola4(P0,P1,P2,P3, i/N), 0.02} texture {tx_plastico }}
#local i = i + 1;
#end
}
#end
#macro tentaculo(P0,P1,P2,Q0,Q1,Q2,N)
#local PM = (P2+Q0)/2;
union {
curva_raio(P0,P1,P2,PM,0.35,0.3,0.2,0.1,N)
curva_raio(PM,Q0,Q1,Q2,0.1,0.07,0.05,0.03,N)
}
#end
#macro tentaculo_animado(param0, param1, param2, param3, tempo, N)
#local M = 18;
#local param = array[M];
#local i=0;
#while (i < M)
#local param[i] = interpola4(param0[i],param1[i], param2[i], param3[i], tempo);
#local i = i+1;
#end
#local P0 = ;
#local P1 = ;
#local P2 = ;
#local Q0 = ;
#local Q1 = ;
#local Q2 = ;
object { tentaculo(P0,P1,P2,Q0,Q1,Q2,N) }
#end
#declare bola = sphere { <0,1,1> 0.2 }
#include "eixos.inc"
union{
object{ eixos(3.00) }
object{ chao translate < 0,0,-5 > texture{ tx_xadrez } }
object { sphere { <0,0,0> 0.7} texture {tx_plastico} }
tentaculo(t2c1[0],t2c1[1],t2c1[2],t2c2[0],t2c2[1],t2c2[2],100)
tentaculo(t3c1[0],t3c1[1],t3c1[2],t3c2[0],t3c2[1],t3c2[2],100)
object { tentaculo_animado(t1ai,t1am1,t1am2,t1af,clock, 100)}
}
#include "camlight.inc"
#declare centro_cena = < 0.00, 0.00, 1.00 >;
#declare raio_cena = 6.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)