// Last edited on 2007-07-23 13:28:01 by stolfi
// Processed by remove-cam-lights

global_settings { max_trace_level 12 }

#declare tinta_xadrez =
  texture {
    pigment { checker color rgb <0.40,0.50,0.60>, color rgb <0.90,0.95,1.00> }
    finish { ambient 0.6 diffuse 0.4 }
  }

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

#declare raio = 2.000;

#declare tinta_A =
  texture {
    pigment { color rgb < 0.10, 0.80, 1.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

#declare tinta_B =
  texture {
    pigment { color rgb < .50, 0.50, 0.50 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

#declare tinta_C =
  texture {
    pigment { color rgb < 0.30, 0.40, 1.00 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

#declare tinta_D =
  texture {
    pigment { color rgb < 0.10, 0.20, 0.50 > }
    finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
  }

#declare bola =
  sphere {
    < 0.00, 0.00, 0.00 >, 2.0
    texture { tinta_B }
  }

#declare furo =
  cylinder {
    < -1.00, -2.00, -2.00 >,
    < +1.00, +2.00, +2.00 >,
    2.00
    texture { tinta_B }
  }

#declare pino =
  cylinder {
    < -2.00, +2.00, -1.00 >,
    < +2.00, -2.00, +1.00 >,
    0.75
    texture { tinta_B }
  }

#declare caixa =
  box {
    < -2.00, 1.00, 2.00 >,
    < +2.00, -1.00, -2.00 >
    texture { tinta_B }
  }

#declare cabeca =
 cone {
    < 0, 0, 1.5 >, 0.2
    < 0, 0, 3.0 >, 1.0
    texture { tinta_B }
}

#declare cabeca1 =
 sphere {
   <0, 0, 2.25 >, 1
   texture { tinta_B }
}

#declare orelha =
 sphere {
   < 0.3, -.5, 3.2 >, 0.4
   texture { tinta_B }
}

#macro mao()
   box{ < 0, 0, 0 >,
        < 0.5, 0.5, 0.2 >
      texture { tinta_B }}
#end

#macro antebraco(a4)
   union{
     cylinder{ <0,0,0>, <2,0,0>, .2
               texture { tinta_B }
             }
     object{ mao()
             rotate a4*x
             translate 2*x
     }
  }
#end

#macro braco(a3,a4)
   union{
     cylinder{ <0,0,0>, <1.5,0,0>, 0.3
               texture { tinta_B }
             }
     object{antebraco(a4)
         rotate a3*y
         translate 1.5*x
 }
}
#end

#macro pe()
   box{ < 0, 0, 0 >,
        < 0.5, 0.5, 0.2 >
      texture { tinta_B }}
#end

#macro canela(a2)
   union{
     cylinder{ <0,0,0>, <2,0,0>, .4
               texture { tinta_B }
             }
     object{ pe()
             rotate a2*x
             translate 2*x
     }
  }
#end

#macro perna(a1,a0)
   union{
     cylinder{ <0,0,0>, <0,0,-1.5>, 0.6
               texture { tinta_B }
             }
     object{canela(a0)
         rotate a1*y
         translate -1.5*z
     }
}
#end

union{
  intersection{
    object { bola }
    object { caixa }
  }
  intersection{
    object { cabeca }
    object { cabeca1 }
  }
}

object {orelha
        scale <.5, 1., 1.>
}
object {orelha
        scale <.5, 1., 1.>
        translate <0, 1, 0>
}

object {braco(-45, 30)
        translate <0, 1.2, 1.3>}

object {braco(-55,0)
        translate <0, -1.2, 1.3>}

object {perna(45,45)
        translate <0, -1, -2>}

object {perna(20,16)
        translate <0, 1, -2>}

// Original camera parameters:
// #local cam_ctr = <0,0,0>
// #local cam_vec = <8.00,3.00,5.00>
// #local cam_sky = z

#include "camlight.inc"
camlight(<0,0,0>,<10,5,5>,15.0,z,1.0)