// Last edited on 2013-12-11 11:18:49 by stolfilocal
// Processed by remove-cam-lights

background{ color rgb < 1,1,1 > }

 #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_borracha =
  texture{
    pigment{ color rgb < 0.21, 0.25, 0.24 > }
    finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 }
  }
  #declare tx_espelho =
  texture{
    pigment{ color rgb < 1.00, 1, 1 > }
    finish{ diffuse 0.2 reflection 0.7*< 0.20, 0.63, 0.87 > ambient 0.1 }
  }
  #declare tx_bico =
  texture{
    pigment{ color rgb < 0.48, 0.25, 0 > }
    finish{ diffuse 0.9 ambient 0.1 }
  }
    #declare tx_roda =
  texture{
    pigment{ color rgb < 0.21, 0.25, 0.24 > }
    finish{ diffuse 0.9 ambient 0.1 }
  }

#declare tx_corpo =
  texture{
    pigment{ color rgb < 0.48,0.66,0.87 > }
    finish{ diffuse 0.9 ambient 0.1 }
  }

#include "eixos.inc"

#macro interpola(p0,p1,tt)
((1-tt)*p0 + tt*p1)
#end

#macro curva(p0,p1,p2,p3,tt)
union{

  #while (tt < 1.5)
 object{
        sphere{
                  interpola4(p0,p1,p2,p3,tt)
                  interpola4(0.1,0.2,0.3,0.4,tt)
                  texture{tx_espelho}
                  }
                  }
  #declare tt=tt+1/40;
  #end
  }
 #end

 #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 tentaculo(p0,p1,p2,q1,q2,q3,tt)
 union{
        #local t1 = tt;
        #local p3 =(p2+q1)/2;
        #local q0 = p3;
 object{curva(p0,p1,p2,p3,tt)rotate<0,0,0>}
 object{curva(q0,q1,q2,q3,tt)rotate<0,0,0>}

        }
 #end

union{
        object{eixos(3.00)}

        object{tentaculo(<(-2)*sin(180*clock),0,0> , <0,1,0>,<0,-1,0>,<0,-1,2>,<0,1,0>,<1,1,3>, 0.01) }

        }
#include "camlight.inc"
#declare centro_cena = < 0.00, 0.00, 0.00 >;
#declare raio_cena = 9.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)