// Last edited on 2007-07-23 21:44:47 by stolfi
// Processed by remove-cam-lights

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

#declare raio = 2.000;

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

#declare cor_prata = <0.7 0.7 0.7>;
#declare tinta_prata =
texture {
 pigment { rgb cor_prata }
 finish {
  ambient 0.05 diffuse 0.1
  reflection cor_prata
  specular 0.3 roughness 0.7
 }
}

#declare cor_ouro =  < 1.00, 0.80, 0.10 >;
#declare tinta_ouro =
texture {
 pigment { rgb cor_ouro }
 finish {
  ambient 0.05 diffuse 0.05
  reflection cor_ouro
  specular 0.20 roughness 0.05
 }
}

#declare cor_ruby = <0.6 0.2 0.1>;
#declare tinta_ruby =
texture {
 pigment { color cor_ruby }
 finish {
  ambient 0.1 diffuse 0.2
  reflection cor_ruby
  specular 1 roughness 0.003
 }
}

#declare cor_esmeralda = <0.1 0.5 0.2>;
#declare tinta_esmeralda =
texture {
 pigment { color cor_esmeralda }
 finish {
  ambient 0.1 diffuse 0.2
  reflection cor_esmeralda
  specular 1 roughness 0.003
 }
}

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

#declare tinta_preta =
texture {
 pigment { color rgb < 0.00, 0.00, 0.00 > }
 finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 }
}

#macro cabeca()
 sphere {
  < 0.00, 0.00, 0.00 >, 0.30
  texture { tinta_ouro }
 }
#end

#macro pescocoEtc()
 union {
  cylinder {
  < 0.00, 0.00, 0.00 >,
  < 0.00, 0.00, 0.30 >,
  0.10
  texture { tinta_branca }
  }
  object { cabeca() translate 0.60*z }
 }
#end

#macro mao()
union {
 sphere {
  < 0.00, 0.00, 0.00 >, 0.15
  texture { tinta_ruby }
 }

}
#end

#macro antebracoEtc()
union {
 sphere {
  < 0.00, 0.00, 0.00 >, 0.10
  texture { tinta_cinza }
 }
 cylinder {
  < 0.00, 0.00, 0.00 >,
  < 1.00, 0.00, 0.00 >,
  0.10
  texture { tinta_cinza }
 }
 object { mao() translate 1.05*x }
}
#end

#macro antebracoEtcClava()
union {
 sphere {
  < 0.00, 0.00, 0.00 >, 0.10
  texture { tinta_cinza }
 }
 cylinder {
  < 0.00, 0.00, 0.00 >,
  < 1.00, 0.00, 0.00 >,
  0.10
  texture { tinta_cinza }
 }
 object { mao() translate 1.05*x }
 cone {
  < 1.05, 0.00, 0.00 >,
  0.10,
  < 2.00, 0.00, 0.00 >,
  0.30
  texture { tinta_cinza }
 }
 sphere {
  < 2.00, 0.00, 0.00 >, 0.30
  texture { tinta_cinza }
 }
}
#end

#macro bracoEtc(abx, aby)
union {
 sphere {
  < 0.00, 0.00, 0.00 >, 0.10
  texture { tinta_esmeralda }
 }
 cylinder {
  < 0.00, 0.00, 0.00 >,
  < 1.00, 0.00, 0.00 >,
  0.10
  texture { tinta_esmeralda }
 }
 object { antebracoEtc() rotate abx*x rotate aby*y translate 1*x }
}
#end

#macro bracoEtcClava(abx, aby)
union {
 sphere {
  < 0.00, 0.00, 0.00 >, 0.10
  texture { tinta_esmeralda }
 }
 cylinder {
  < 0.00, 0.00, 0.00 >,
  < 1.00, 0.00, 0.00 >,
  0.10
  texture { tinta_esmeralda }
 }
 object { antebracoEtcClava() rotate abx*x rotate aby*y translate 1*x }
}
#end

#macro pe()
 sphere {
  < 0.00, 0.00, 0.00 >, 0.20
  texture { tinta_preta }
 }
#end

#macro pernaEtc()
union {
 sphere {
  < 0.00, 0.00, 0.00 >, 0.15
  texture { tinta_cinza }
 }
 cylinder {
  < 0.00, 0.00, 0.00 >,
  < 0.00, 0.00, -1.50 >,
  0.15
  texture { tinta_cinza }
 }
 object { pe() translate -1.6*z }
}
#end

#macro coxaEtc(px, py)
union {
 sphere {
  < 0.00, 0.00, 0.00 >, 0.15
  texture { tinta_esmeralda }
 }
 cylinder {
  < 0.00, 0.00, 0.00 >,
  < 0.00, 0.00, -1.50 >,
  0.15
  texture { tinta_esmeralda }
 }
 object { pernaEtc() rotate px*x rotate py*y translate -1.5*z }
}
#end

#macro troncoEtc(bdx, bdy, bex, bey, abdx, abdy, abex, abey, cdx, cdy, cex, cey, pdx, pdy, pex, pey)
 union {
  cylinder {
   < 0.00, 0.00, 0.00 >,
   < 0.00, 0.00, 2.00 >,
   0.50
   texture { tinta_prata }
  }
  object { pescocoEtc() translate 2*z }
  object { bracoEtcClava(abdx, abdy) rotate bdx*x rotate bdy*y translate 0.50*x translate 1.9*z }
  object { bracoEtc(abex, abey) rotate bex*x rotate bey*y translate -0.50*x translate 1.9*z }
  object { coxaEtc(pdx, pdy) rotate cdx*x rotate cdy*y translate 0.30*x }
  object { coxaEtc(pex, pey) rotate cex*x rotate cey*y translate -0.30*x }
 }
#end

#declare tt = clock;
#declare bdy_b = 270 + 90*tt;
#declare bey_b = 135 - 35*tt;
#declare abdy_b = -90 + 90*tt;
#declare abey_b = 90 - 90*tt;
#declare cdx_b = 0 + 45*tt;
#declare cex_b = 45 - 45*tt;

object{ troncoEtc(0, bdy_b, 45, bey_b,  0, abdy_b, 90, abey_b,  cdx_b, 0, cex_b, 0, -45, 0, -45, 0) }

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

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