#declare tx_bug = 
  texture{
    pigment{ color rgb < 1.00, 0.20, 0.00 > }
    finish{ diffuse 0.5 ambient 0.5 }
  }

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

  #declare tx_xadrez =
  texture{
    pigment{ checker color rgb < 0.9, 0.7, 0.80 >, color rgb < 0.00, 0.07, 0.70 > }
    finish{ diffuse 0.9 ambient 0.1 }
    scale 1.5
  }

#macro tanqu1(_x,_y)
  #local Cn1 = cone {
  <_x, _y, 0>, 1.0 // <x, y, z>, center & radius of one end
  <_x, _y, 5>, 0 // <x, y, z>, center & radius of the other end

  }
  #local S1 = sphere {
  <_x, _y, 7>, 2 // <x, y, z>, radius

  }
  #local C1 = cylinder {
  <_x+1, _y, 7>, <_x+1.5, _y, 7>, 0.3 // center of one end, center of other end, radius
  }
  #local C2 = cylinder {
  <_x+1, _y+1, 7>, <_x+1.5, _y+1.5, 7>, 0.3 // center of one end, center of other end, radius
  }
  #local C3 = cylinder {
  <_x-1, _y+1, 7>, <_x-1.5, _y+1.5, 7>, 0.3 // center of one end, center of other end, radius
  }
  
  union{
    object{Cn1}
    object{S1}
    object{C1}
    object{C2}
    object{C3}

  }
  
#end

#macro gera_tanques(m,n)
union{
  #for (i,0,m-1)
    #for (j,0,n-1)
      object{ tanqu1(i*2,j*2) texture {tx_plastico}}
    #end
  #end 
}
#end

#include "eixos.inc"

#declare chao = 
object{ eixos(3.00) }
box{ <-20,-20,-1>, <+20,+20,0> texture{ tx_bug} }

#declare nfilas = 7;
#declare ncols = 5;

union{
  object {gera_tanques(nfilas, ncols)}
}

#declare tam_cena = < 2*nfilas, 2*ncols, 8>;

#include "camlight.inc"
#declare centro_cena = 0.5*tam_cena;
#declare raio_cena = 0.6*(vlength(tam_cena) + 1);
#declare dir_camera = < 14.00, 7.00, 4.00 >;
#declare dist_camera = 5*raio_cena;
#declare intens_luz = 1.20;
camlight(centro_cena, raio_cena, dir_camera, dist_camera, z, intens_luz)