// Last edited on DATE TIME by USER
// Processed by remove-cam-lights

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

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

#declare tx_verde =
  texture{
    pigment{ color rgb < 0, 1, 0 > filter 0.70 }
    finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 }
  }

#declare tx_preto =
  texture{
    pigment{ color rgb < 0.0, 0.0, 0.00 > filter 0.70 }
    finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 }
  }

#declare tx_fosca =
  texture{
    pigment{ color rgb < 1.00, 0.80, 0.10 > }
    finish{ diffuse 0.9 ambient 0.1 }
  }

#declare tx_xadrez =
  texture{
    pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > }
    finish{ diffuse 0.9 ambient 0.1 }
    scale 2.0
  }

#declare tx_branco =
  texture{
    pigment{ color rgb < 1.00, 1.00, 1.00 > }
    finish{ diffuse 0.9 ambient 0.1 }
  }

#macro cabeca(textura)
  union{sphere{ <0,0,1>, 1
    texture{ textura }
  }}
#end

#macro pescoso(textura)
  union{cylinder{ <0,0,-0.5>, <0,0,0.0>, 0.2
    texture{ textura }
  }}
#end

#macro bracoDir(textura)
  union{
    cylinder{ <0.2,-2,-1>, <0,-1,0>, 0.4
    texture{ textura }
  }}
#end

#macro bracoEsq(textura)
  union{
  cylinder{ <0.2,2,-1>, <0,1,0>, 0.4
    texture{ textura }
  }}
#end

#macro corpo(textura)
    union{box{ <0.8,-1.1,-3>, <-0.8, 1.1,-0.3> texture{textura} } }
#end

#macro perna(textura)
  union{
    cylinder{ <0,0,-3>, <0,0,-5>, 0.45
      texture{ textura }
    }
  }
#end

#macro pessoa(texturaCorpo, texturaResto)
  union{
    object{ cabeca(texturaResto) }
    object{ pescoso(texturaResto) }
    object{ bracoDir(texturaResto) translate < 0, 0,-0.8 >}
    object{ bracoEsq(texturaResto) translate < 0, 0,-0.8 >}
    object{ corpo(texturaCorpo) }
    object{ perna(texturaResto) translate < 0, -0.5,0 > }
    object{ perna(texturaResto) translate < 0, 0.5,0 > }
    scale 0.2
    translate < 0, 0, 2 >
  }
#end

#macro boxEscada(tamanho)
  union{
    box{ <0,0,0>, <-1,tamanho,1> }
  }
#end

#macro Escada1(inicio, tamanho, fileira, textura)
  union{
    #declare i = 0;
    #declare k = 0;
    #while (k <fileira )
      object { boxEscada(tamanho) translate <i,inicio,k> texture{textura} }
      #declare i = i - 0.5;
      #declare k = k + 0.5;
    #end
    scale 0.3
  }
#end

#macro Escada2(inicio, tamanho, fileira, textura)
  union{
    #declare i = 0;
    #declare k = 0;
    #while (k <fileira )
      object { boxEscada(tamanho) translate <i,inicio,k> texture{textura} }
      #declare i = i + 0.5;
      #declare k = k + 0.5;
    #end
    scale 0.3
  }
#end

#declare grama =
  union{
    box{
      <0,-10,0>,<8,9,0>
    }
  }

#declare gol1 =
  union{
    cylinder{
      <3.0, -9.8, 0>,<3.0, -9.8, 1.5>
      0.2
      texture{ tx_branco }
    }
    cylinder{
      <5.0, -9.8, 0>,<5.0, -9.8, 1.5>,
      0.2
      texture{ tx_branco }
    }
    cylinder{
      <3.0, -9.8, 1.4>,<5.0, -9.8, 1.4>,
      0.2
      texture{ tx_branco }
    }
  }

#declare gol2 =
  union{
    cylinder{
      <3.0, 8.8, 0>,<3.0, 8.8, 1.5>,
      0.2
      texture{ tx_branco }
    }
    cylinder{
      <5.0, 8.8, 0>,<5.0, 8.8, 1.5>,
      0.2
      texture{ tx_branco }
    }
    cylinder{
      <3.0, 8.8, 1.4>,<5.0, 8.8, 1.4>,
      0.2
      texture{ tx_branco }
    }
  }

#declare area1 =
  union{
    box{
      <1.5,-10,0>, <2,-7,0.1>
    }
    box{
      <1.5,-7,0>, <6.5,-7.5,0.1>
    }
    box{
      <6.5,-7.5,0>, <6,-10,0.1>
    }
  }

#declare area2 =

union{
    box{
      <1.5,9,0>, <2,6,0.1>
    }
    box{
      <1.5,6,0>, <6.5,6.5,0.1>
    }
    box{
      <6.5,6.5,0>, <6,9,0.1>
    }
  }

#declare marcacaoMeio =
    box{
     <0, -0.25, 0>,
     <8, 0.25, 0>
    }

#declare esfera_central =
  difference{
    sphere{
      <4,0,0> 2.5
      texture{ tx_branco}
    }

    sphere{
      <4,0,0> 2.0
      texture{ tx_branco}
    }
  }

#declare centroMarcacao =
  intersection{
    object{ grama }
    object{ esfera_central }
    texture{ tx_branco }
  }

#declare campo =
  union{
    object{ grama texture{ tx_verde } }
    object{ centroMarcacao translate<0,0,0.2> }
    object{ area1  texture{ tx_branco } translate<0,0,0.1> }
    object{ area2  texture{ tx_branco } translate<0,0,0.1> }
    object{ marcacaoMeio texture{ tx_branco } translate<0,0,0.1> }
    object{ gol1 }
    object{ gol2 }
  }

#declare roleta = seed(315);

#include "eixos.inc"

union{

  object{ eixos(3.00) }

  union{
    object{ Escada1(-7, 8,8, tx_verde) translate<-1,-2,0>}
    object{ Escada1(1, 5,8, tx_red) translate<-1,-2,0>}
    object{ Escada1(6, 8,8, tx_xadrez) translate<-1,-2,0>}
    object{ Escada1(14, 3,4, tx_red) translate<-1,-2,0>}
    translate<-1.2,0.45,0>
  }

  union{
    object{ Escada2(-7, 8,8, tx_verde) translate<1,-2,0>}
    object{ Escada2(1, 5,8, tx_red) translate<1,-2,0>}
    object{ Escada2(6, 8,8, tx_xadrez) translate<1,-2,0>}
    object{ Escada2(14, 3,4, tx_red) translate<1,-2,0>}
    translate<0.3,0.45,0>
  }

union{

  #declare i = 0;
  #declare k = 0;
  #while (k <8 )

    #declare j = -9;
    #while (j < 12 )
      #if(rand(roleta) < 0.25)
        object{pessoa(tx_xadrez, tx_preto) translate <i,j,k>}
      #else
        #if(rand(roleta) < 0.50)
          object{pessoa(tx_red, tx_xadrez) translate <i,j,k> }
        #else
          object{pessoa(tx_xadrez, tx_xadrez) translate <i,j,k> }
        #end
      #end
      #declare j = j + 1.3;
    #end
    #declare i = i - 1;
    #declare k = k + 1;
  #end
  scale 0.3
  translate<-2.4,-0.8,0>
}

union{

  #declare i = 0;
  #declare k = 0.1;
  #while (k <8 )

    #declare j = -9;
    #while (j < 12 )
      #if(rand(roleta) < 0.25)
        object{pessoa(tx_xadrez, tx_red) translate <i,j,k>}
      #else
        #if(rand(roleta) < 0.50)
          object{pessoa(tx_red, tx_red) translate <i,j,k> }
        #else
          object{pessoa(tx_preto, tx_preto) translate <i,j,k> }
        #end
      #end
      #declare j = j + 1.5;
    #end
    #declare i = i + 0.5;
    #declare k = k + 0.5;
  #end
  scale 0.3
  translate<1.0,-0.8,0>
}

object {campo scale 0.4 translate <-2.2,0,0>}

}

#include "camlight.inc"
#declare centro_cena = < 0.00, 0.00, 1.00 >;
#declare raio_cena = 6.0;
#declare dir_camera = < -2.00, 2.00, 2.00 >;
#declare dist_camera = 16.0;
#declare intens_luz = 1.00;
camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)