// Last edited on 2009-07-24 11:31:29 by stolfilocal
// Processed by remove-cam-lights

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

global_settings { max_trace_level 10 }

#declare colorDarkBlue = 
  texture {
    pigment { color rgb < 0.00, 0.00, 0.80 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.205 ambient 0.1 }
  }

#declare colorLightBlue = 
  texture {
    pigment { color rgb < 0.00, 0.40, 1.00 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.205 ambient 0.1 }
  }

#declare colorDarkGreen = 
  texture {
    pigment { color rgb < 0.00, 0.80, 0.00 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 }
  }
  
#declare colorLightGreen = 
  texture {
    pigment { color rgb < 0.00, 1.00, 0.00 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 }
  }
  
#declare colorYellow =
  texture {
    pigment { color rgb < 1.00, 1.00, 0.00 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 }
  }
  
#declare colorGlassRed =
  texture {
    pigment { color rgb < 0.95, 0.05, 0.05 > filter 0.8 }
    finish { diffuse 0.1 ambient 0.1 }
  }
  
#declare colorGlassRed1 =
  texture {
    pigment { color rgb < 0.95, 0.05, 0.05 > transmit 0.8 }
    finish { diffuse 0.1 ambient 0.1 }
  }
  
#declare colorRed =
  texture {
    pigment { color rgb < 1.00, 0.00, 0.00 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 }
  }
  
#declare colorBrown = 
  texture {
    pigment { color rgb < 0.90, 0.90, 0.75 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.1 }
  }
  
#declare colorGrey = 
  texture {
    pigment { color rgb < 0.70, 0.70, 0.70 > }
    finish { diffuse 0.8 specular 0.1 roughness 0.205 ambient 0.1 }
  }
  
#declare colorGlassGrey = 
  texture {
    pigment { color rgb < 0.70, 0.70, 0.70 > filter 0.8 }
    finish { diffuse 0.1 specular 0.5 roughness 0.205 ambient 0.1 }
  }
  
#declare colorMetalGrey1 = 
  texture {
    pigment { color rgb < 0.70, 0.70, 0.70 > }
    finish { diffuse 0.1 ambient 0.1 reflection 0.8 }
  }
  
#declare colorMetalGrey2 = 
  texture {
    pigment { color rgb < 0.50, 0.50, 0.50 > }
    finish { diffuse 0.3 ambient 0.2 reflection 0.5 }
  }
  
#declare colorArray = array[6] {colorDarkBlue,colorLightBlue,colorDarkGreen,colorLightGreen,colorYellow,colorRed};

#declare eixos = 
  merge {
  box { < 0, 0, 0 > , < 10, 0.1, 0.1 > texture { colorDarkBlue } }
  box { < 0, 0, 0 > , < 0.1, 10, 0.1 > texture { colorDarkGreen }  }
  box { < 0, 0, 0 > , < 0.1, 0.1, 10 > texture { colorRed } }
  }
  

#declare garfo =
  merge {
  box { < -0.90, 0, 0 >, < -0.70, 1.7, 0.1 > texture { colorGrey } }
  box { < -0.10, 0, 0 >, < 0.10, 1.5, 0.1 > texture { colorGrey } }
  box { < 0.70, 0, 0 >, < 0.90, 1.7, 0.1 > texture { colorGrey } }
  box { < -0.90, -1.0, 0 >, < 0.90, 0, 0.1 > texture { colorGrey } }
  }

#declare faca = 
  box { < 0, 0, 0 >, < 0.1, 2.7, 0.8 > texture { colorGrey } }
  

#declare base = 
  cylinder { < 0, 0, -0.1 >, < 0, 0, 0.1 >, 4 texture { colorYellow } }
  

#macro mao_direita()
  union {
    sphere { < 0, 0, 0 >, 0.8 texture { colorMetalGrey1 } }
    cylinder { < 0.5, 0, 0 >, < 5.5, 0, 0 >, 0.5 texture { colorGrey } }
    object { garfo rotate < 0, 0, 270 > translate < 5.8, 0, 0 >  }
  }
#end

#macro mao_esquerda()
  union {
    sphere { < 0, 0, 0 >, 0.8 texture { colorMetalGrey1 } }
    cylinder { < 0.5, 0, 0 >, < 5.5, 0, 0 >, 0.5 texture { colorGrey } }
    object { faca rotate < 0, 0, 270 > translate < 5.5, 0, -0.4 >  }
  }
#end

#macro antebraco_direito(m_vert,m_horz)
  union {
    sphere { < 0, 0, 0 >, 0.8 texture { colorMetalGrey1 } }
    cylinder { < 0.5, 0, 0 >, < 5.5, 0, 0 >, 0.5 texture { colorGrey } }
    object { mao_direita() rotate < 0, m_vert, m_horz > translate < 5.8, 0, 0 > }
  }
#end

#macro antebraco_esquerdo(m_vert,m_horz)
  union {
    sphere { < 0, 0, 0 >, 0.8 texture { colorMetalGrey1 } }
    cylinder { < 0.5, 0, 0 >, < 5.5, 0, 0 >, 0.5 texture { colorGrey } }
    object { mao_esquerda() rotate < 0, -m_vert, -m_horz > translate < 5.8, 0, 0 > }
  }
#end

#macro braco_direito(b_vert,b_horz,m_vert,m_horz)
  union {
    sphere { < 0, 0, 0 >, 0.8 texture { colorMetalGrey1 } }
    cylinder { < 0.5, 0, 0 >, < 5.5, 0, 0 >, 0.5 texture { colorGrey } }
    object { antebraco_direito(m_vert,m_horz) rotate < 0, b_vert, b_horz > translate < 5.8, 0, 0 > }
  }
#end

#macro braco_esquerdo(b_vert,b_horz,m_vert,m_horz)
  union {
    sphere { < 0, 0, 0 >, 0.8 texture { colorMetalGrey1 } }
    cylinder { < 0.5, 0, 0 >, < 5.5, 0, 0 >, 0.5 texture { colorGrey } }
    object { antebraco_esquerdo(m_vert,m_horz) rotate < 0, -b_vert, -b_horz > translate < 5.8, 0, 0 > }
  }
#end

#macro tronco(te_vert,td_vert,te_horz,td_horz,be_vert,bd_vert,be_horz,bd_horz,me_vert,md_vert,me_horz,md_horz)
  union {
    sphere { < 0, 0, 0 >, 0.8 texture { colorMetalGrey1 } }
    cylinder { < 0, 0, 0.5 >, < 0, 0, 8.5 >, 0.5 texture { colorGrey } }
    object { braco_direito(bd_vert,bd_horz,md_vert,md_horz) 
             rotate < td_vert, 0, td_horz > 
             translate < 0, 0, 8.8 > 
             rotate < 0, 0, 0 > 
    }
    object { braco_esquerdo(be_vert,be_horz,me_vert,me_horz) 
             rotate < -te_vert, 0, -te_horz > 
             translate < 0, 0, 8.8 > 
             rotate < 0, 0, 90 > 
    }
  }
#end
  

plane { z , 0 
  texture { 
    pigment { checker rgb < 1.0,0.9,0.8 >, rgb < 0.8,0.7,0.6 > rotate 17*z }
    finish { diffuse 0.5 ambient 0.5 }
  }
  scale 2
  translate -10*z
}

union {
  object { base }
  object { tronco(-15,15,-15,15,-45,45,45,45,30,-30,30,30) }
  translate < 0, 10, 0 >
}
union {
  object { base }
  object { tronco(0,0,0,0,0,0,0,0,0,0,0,0) }
  rotate < 0, 0, 90 > translate < 10, 0, 0 > 
}

// Original camera parameters:
// #local cam_ctr = <0,0,0>
// #local cam_vec = <25.00,35.00,15.00>
// #local cam_sky = z

#include "camlight.inc"
camlight(<-1,3,0>,<3,10,5>,45.0,z,1.0)