// Last edited on 2005-01-06 00:31:24 by stolfi
// Processed by remove-cam-lights

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

#declare textura1 =
  texture {
    pigment {color rgb <0.3,0.3,0.1>}
    finish {
      ambient 0.1 diffuse 0.5
      reflection 0.1
      specular 0.90 roughness 0.005
    }
  };
#declare textura2 =
  texture {
    pigment {color rgb <0,0.9,0>}
    finish {
      ambient 0.1 diffuse 0.5
      reflection 0.1
      specular 0.90 roughness 0.005
    }
  };
#declare textura3 =
  texture {
    pigment {color rgb <0.5,0.5,0.5>}
    finish {
      ambient 0.2 diffuse 0.8
      reflection 0.2
      specular 0.90 roughness 0.005
    }
  };

#declare MAX_SIZE = 20;
#declare MAX_SIZE_MEDIA = 50;

#macro Barra(atual, total, val1, val2)
 union {
  cylinder {
   <0,0,0>,<0,0.1+val1*MAX_SIZE,0>,4
   texture {textura1}
  }
  cylinder {
   <0,0.1+val1*MAX_SIZE,0>,<0,0.2+val1*MAX_SIZE+val2*MAX_SIZE,0>,2
   texture {textura2}
  }
  translate <45,10,0>
  rotate (-160/total * atual)*y
  translate <0,0,15>
 }
#end

#macro BarraMedia(val1, val2)
 union {
  cylinder {
   <0,0,0>,<0,0.1 + val1*MAX_SIZE_MEDIA,0>,18
   texture {textura1}
  }
  cylinder {
   <0,val1*MAX_SIZE_MEDIA,0>,<0,0.1+val1*MAX_SIZE_MEDIA+val2*MAX_SIZE_MEDIA,0>,9
   texture {textura2}
  }
  translate <0,10,20>
 }
#end

plane {y, 0
  texture {
    pigment{checker <0.2,0.2,0.2>,<0.3,0.3,0.3>}
    finish {ambient 0.2 diffuse 0.8 reflection 0.05}
    scale 30.0
  }
}

union {
 union {
  box {<-90,0,-10>, <90,90,0>}
  box {<-90,0,0>, <90,10,90>}
  texture {textura3}
 }
 #include "dados.inc"
}

#include "camlight.inc"
camlight(<-10,25,0>,<120,55,200>,1.00,y,1.0)