// Exemplo de arquivo de descricao de cena para POV-ray
// Last edited on 2023-12-24 15:58:32 by stolfi
// Original version by jstolfi
// Moved Around by jevs

// background{ color rgb < 0.45, 0.10, 0.20 > }
background{ color rgb < 0, 0, 0 > }

#declare tx_torso = 
  texture{
    pigment{ color rgb < 0.10, 0.80, 1.00 > }
    finish{ diffuse 0.8 ambient 0.2 }
  }

#declare tx_membro = 
  texture{
    pigment{ color rgb < 1.0, 1.0, 0.0 > }
    finish{ diffuse 0.8 ambient 0.2 }
  }

#declare tx_xadrez =
  texture{
    pigment{ checker color rgb < 0.900, 1.000, 0.870 >, color rgb < 0.900, 0.900, 0.900 > }
    finish{ diffuse 0.9 ambient 0.1 }
    scale 5.0
  }

#macro mao()
   #local maum =  cylinder {
    <0, 0, 0>, <0, 0, 0.5>, 0.25 // center of one end, center of other end, radius
  }
  
  object{maum}

#end

#macro antebraco(D5)
  #local antebrassu =  cylinder {
    <0, 0, 0>, <0, 0, 1>, 0.25 // center of one end, center of other end, radius
    open // remove end caps
  }

  #local m = mao()

  union{
    object{m translate <0, 0, 1> rotate <0, D5, 0> }
    object{antebrassu}
    texture { tx_membro }
  }

#end

#macro braco(M4, D5)

  #local brassu = cylinder { <0, 0, 0>, <0, 0, 2>, 0.25 open }
  #local sub = antebraco(D5)

  union {
    object{sub translate <0, 0, 2> rotate <0, M4, 0>  }
    object{ brassu }
    texture { tx_membro }
  }

#end

#macro perna(T1, T2, T3, M4, D5)

  #local membro = braco(M4, D5)

  object{membro translate <0, 0, 0>  rotate<T1, T2, T3> texture { tx_membro } }

#end

#macro cabeca(T1, T2, T3, M4)

#end

#macro robo(E)
  #local torso = box { <-1, -1, -1>, <1, 1, 1> }

#end

#declare raio = 2.000;
#declare raioIni = 3;

#declare chao = 
  disc {
    <0, 0, 0>, <0, 0, 1>, 200
    texture {
      tx_xadrez
    }
  }
  
#include "eixos.inc"

#declare DX = 3;
#declare DY = 2;
#declare DZ = 3;

union{
    // object{ eixos(3.00)}

    perna(0, 30, 0, 20, -30)

    object{ chao  translate < 0,0,-5 > texture{ tx_xadrez } }
}

#declare cmin = < -DX+2, -DY, -DZ+2 >;
#declare cmax = < +DX,   +DY, +DZ >;

#include "gaiola.inc"
// object{ gaiola(cmin,cmax) }

#declare centro_cena = (cmin + cmax)/2;
#declare raio_cena = 0.45*vlength(cmax-cmin);
#declare dist_camera = 7*raio_cena;

#include "camlight.inc"
#declare dir_camera = < 10.00, 15.00, 10.00 >;
#declare intens_luz = 1.20;
camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)