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

background { color rgb < 0.74, 0.84, 0.92 > }

#declare roleta = seed(11031997);

#declare tx_azul =
  texture {
    pigment { color rgb <0.34, 0.45, 0.6> }
    finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 }
  }

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

#declare tx_laranja =
  texture {
    pigment { color rgb <0.96, 0.55, 0.26> }
    finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 }

  }

#declare tx_verde =
  texture {
    pigment { color rgb <0.34, 0.6, 0.45> }
    finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 }
  }

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

#macro carroceria(PP, NH, NV)
  union {
    #declare H = 0;
    #while (H < NH)

      #declare V = 0;
      #while (V < NV)

        #declare P = array[4][4] {
          { PP[H][V][0][0], PP[H][V][0][1], PP[H][V][0][2], PP[H][V][0][3] },
          { PP[H][V][1][0], PP[H][V][1][1], PP[H][V][1][2], PP[H][V][1][3] },
          { PP[H][V][2][0], PP[H][V][2][1], PP[H][V][2][2], PP[H][V][2][3] },
          { PP[H][V][3][0], PP[H][V][3][1], PP[H][V][3][2], PP[H][V][3][3] },
        };

        retalho(P, 0.01, tx_verde, tx_vermelho)

        #declare V = V + 1;
      #end

      #declare H = H + 1;
    #end
  }
#end

#include "eixos.inc"
#include "retalho-simples.inc"

union {

  #declare NH = 3; //3;
  #declare NV = 2;

  #declare PP = array[NH][NV][4][4] {

    {

      {
        { < +00, +00, +00 >, < +00, +00, +06 >, < +02, +00, +06 >, < +12, +00, +06 > },
        { < +00, +04, +00 >, < +00, +04, +06 >, < +02, +04, +06 >, < +12, +04, +06 > },
        { < +00, +08, +00 >, < +00, +08, +06 >, < +02, +08, +06 >, < +12, +08, +06 > },
        { < +00, +12, +00 >, < +00, +12, +06 >, < +02, +12, +06 >, < +12, +12, +06 > },
      },

      {
        { < +00, +12, +00 >, < +00, +12, +06 >, < +02, +12, +06 >, < +12, +12, +06 > },
        { < +00, +16, +00 >, < +00, +16, +06 >, < +02, +16, +06 >, < +12, +16, +06 > },
        { < +00, +20, +00 >, < +00, +20, +06 >, < +02, +20, +06 >, < +12, +20, +06 > },
        { < +00, +24, +00 >, < +00, +24, +06 >, < +02, +24, +06 >, < +12, +24, +06 > },
      },
    },

    {

      {
        { < +12, +00, +06 >, < +19, +00, +12 >, < +20, +00, +12 >, < +33, +00, +12 > },
        { < +12, +04, +06 >, < +19, +04, +12 >, < +20, +04, +12 >, < +33, +04, +12 > },
        { < +12, +08, +06 >, < +19, +08, +12 >, < +20, +08, +12 >, < +33, +08, +12 > },
        { < +12, +12, +06 >, < +19, +12, +12 >, < +20, +12, +12 >, < +33, +12, +12 > },
      },

      {
        { < +12, +12, +06 >, < +19, +12, +12 >, < +20, +12, +12 >, < +33, +12, +12 > },
        { < +12, +16, +06 >, < +19, +16, +12 >, < +20, +16, +12 >, < +33, +16, +12 > },
        { < +12, +20, +06 >, < +19, +20, +12 >, < +20, +20, +12 >, < +33, +20, +12 > },
        { < +12, +24, +06 >, < +19, +24, +12 >, < +20, +24, +12 >, < +33, +24, +12 > },
      },
    },

    {

      {
        { < +33, +00, +12 >, < +39, +00, +12 >, < +43, +00, +08 >, < +42, +00, +00 > },
        { < +33, +04, +12 >, < +39, +04, +12 >, < +43, +04, +08 >, < +42, +04, +00 > },
        { < +33, +08, +12 >, < +39, +08, +12 >, < +43, +08, +08 >, < +42, +08, +00 > },
        { < +33, +12, +12 >, < +39, +12, +12 >, < +43, +12, +08 >, < +42, +12, +00 > },
      },

      {
        { < +33, +12, +12 >, < +39, +12, +12 >, < +43, +12, +08 >, < +42, +12, +00 > },
        { < +33, +16, +12 >, < +39, +16, +12 >, < +43, +16, +08 >, < +42, +16, +00 > },
        { < +33, +20, +12 >, < +39, +20, +12 >, < +43, +20, +08 >, < +42, +20, +00 > },
        { < +33, +24, +12 >, < +39, +24, +12 >, < +43, +24, +08 >, < +42, +24, +00 > },
      },
    },
  };

  carroceria(PP, NH, NV)

}

#include "camlight.inc"
#declare centro_cena = < 15.00, 5.00, 2.00 >;
#declare raio_cena = 35.0;
#declare dir_camera = < -20.00, -20.00, 10.00 >;

#declare dist_camera = 5*raio_cena;
#declare intens_luz = 1.20;
camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)