// Last edited on DATE TIME by USER
// Processed by remove-cam-lights

  

  

  

background{ color rgb < 0.75, 0.80, 0.85 > }

#declare raio = 2.000;

#declare tinta_A = 
  texture {
    pigment { color rgb < 1.65, 0.42, 0.42 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 }
  }

#declare tinta_B = 
  texture {
    pigment { color rgb < 0.5, 0.5, 0.5 > }
   finish { diffuse 0.8 ambient 0.1 specular 0.5}
  }
  
#declare tinta_C = 
  texture {
    pigment { color rgb < 2.05, 2.05, 2.05 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 }
  }

#declare caixa_aux1 = 
box {
<-2, -2, -2>, 
<2, -0.05, 2>
texture {tinta_C}
}

#declare caixa_aux2 = 
box {
<-2, 0.05, -2>, 
<2, 2, 2>
texture {tinta_C}
}

#declare caixa_aux3 = 
box {
<-2, -2, 0.3>, 
<2, 2, 2>
texture {tinta_C}
}

#declare caixa_aux4 = 
box {
<-2, -2, -2>, 
<-0.1, 2, 2>
texture {tinta_C}
}

#declare sp_aux1 = 
sphere {
    < 0, 0, 1 >, 
    1
    texture { tinta_C }
}

#declare cabo1 =
  cylinder {
    < 0, 0, 0 >,
    < 0, 0, 1 >,
    0.2
    texture { tinta_A }
  }

#declare base1 =
cylinder {
<0 ,0 ,0>,
<0 ,0, 1>, 
3
texture {tinta_A}
}

#declare braco =
 union{
  cylinder {
    < 0, 0, 0 >,
    < 0, 0, 3 >,
    0.3
    texture { tinta_C }
  }
  sphere {
  < 0, 0, 0 >, 
  0.3
  texture { tinta_C }
}
 sphere {
  < 0, 0, 3 >, 
  0.3
  texture { tinta_C }
}
}

#declare prato = 
  cylinder {
    < 0, 0, 0 >,
    < 0, 0, 2.5 >,
    3
    texture { tinta_C }
  }

#macro Garfo()
union{
   object {cabo1 rotate <0, 90, 0>  translate<0, 0, 0.2>}
difference{
 object {sp_aux1}
 union{ 
 object {caixa_aux1}
 object {caixa_aux2}
 object {caixa_aux3}
 object {caixa_aux4}
}
 scale<2,1,1>
 translate <1, 0, 0>
}
}
#end

#macro t1(alfa,beta)
union{
object{braco rotate<0, 90, 0>}
object{Garfo() rotate<0, alfa, beta> translate<3,0,0>}
}
#end

#macro t2(ang_t2, alfa, beta)
union{
object{braco scale<1.5,1.5,1.5> rotate<0, 90, 0>}
object{t1(alfa,beta) rotate<0, ang_t2, 0> translate<4.5,0,0>}
}
#end
  
#macro t3(ang_t3, ang_t2, alfa, beta)
union{
object{braco scale<2,2,1> rotate<0, 90, 0>}
object{t2(ang_t2,alfa,beta) rotate<0, ang_t3, 0> translate<3,0,0>}
}
#end

#macro base(ang, ang_t3, ang_t2, alfa, beta)
union{
object{base1}
object{t3(ang_t3,ang_t2,alfa,beta) rotate<0, -90, 0> translate<0,0,1> rotate<0,0,ang>}
}
#end

#declare c0 = 0.0;
#declare c1 = 0.125;
#declare c2 = 0.25;
#declare c3 = 0.375;
#declare c4 = 0.5;
#declare c5 = 0.625;
#declare c6 = 0.75;
#declare c7 = 0.875;
#declare c8 = 1.0;

#declare ang1 = 0;
#declare ang2 = 0;
#declare ang3 = 0;

#macro quadro(ck)
  
  #if((ck >= c0)&(ck < c2))
     #declare rr = (ck - c0)/(c2 - c0);
     #declare ss = (c2 - ck)/(c2 - c0);
     #declare ang1=ss*45 + rr*90;
     #declare ang2=ss*45 + rr*25;
     #declare ang3=ss*45 - rr*20;
  #end

  #if((ck >= c2)&(ck < c3))
     #declare rr = (ck - c2)/(c3 - c2);
     #declare ss = (c3 - ck)/(c3 - c2);
     #declare ang1=ss*90 + rr*60;
     #declare ang2=ss*25 + rr*110;
     #declare ang3=ss*(-20) - rr*70;
  #end

  #if((ck >= c3)&(ck < c4))
     #declare rr = (ck - c3)/(c4 - c3);
     #declare ss = (c4 - ck)/(c4 - c3);
     #declare ang1=ss*60 + rr*90;
     #declare ang2=ss*110 + rr*25;
     #declare ang3=ss*(-70) - rr*20;
  #end

  #if((ck >= c4)&(ck < c6))
     #declare rr = (ck - c4)/(c6 - c4);
     #declare ss = (c6 - ck)/(c6 - c4);
     #declare ang1=ss*90 + rr*45;
     #declare ang2=ss*25 + rr*45;
     #declare ang3=ss*(-20) + rr*45;
  #end

  #if((ck >= c6)&(ck < c7))
     #declare ss = (c7 - ck)/(c7 - c6);
     #declare ang1=45;
     #declare ang2=45;
     #declare ang3=ss*45;
  #end

  #if((ck >= c7)&(ck < c8))
     #declare rr = (ck - c7)/(c8 - c7);
     #declare ang1=45;
     #declare ang2=45;
     #declare ang3=rr*45;
  #end

  object{base(0, ang1, ang2, ang3, 0)}

  #end
  

object{prato translate<7,0,0>}
object{quadro(clock)}
object{quadro(mod(clock+0.30,1.0)) rotate<0,0,180> translate <15,0,0>}

plane{z, 0
texture {pigment{checker rgb <1,1,1>, rgb <0.5,0.5,0.5>}
finish{diffuse 0.5 ambient 0.5}
}
translate -10*z
}

// Original camera parameters:
// #local cam_ctr = <8,3,3>
// #local cam_vec = (<7.00,-32.00,10.00>-<8,3,3>)
// #local cam_sky = z

#include "camlight.inc"
camlight(<8,3,3>,<10,10,10>,20.0,z,1.0)