// Last edited on 2013-11-04 20:38:53 by stolfilocal
// Processed by remove-cam-lights

#include "textures.inc"

background{ color rgb < 0.9, 0.7, 0.5 > }

#declare tx_verde =
  texture{
    pigment{ color rgb < 0, 1, 0 > }
    finish{ diffuse 0.9 ambient 0.1 }
  }

#declare tx_azul =
  texture{
    pigment{ color rgb < 0, 0.7, 1 > }
    finish{ diffuse 0.9 ambient 0.1 }
  }

#declare tx_vermelho =
  texture{
    pigment{ color rgb < 1, 0, 0 > }
    finish{ diffuse 0.9 ambient 0.1 }
  }

#declare tx_amarelo =
  texture{
    pigment{ color rgb < 1, 1, 0 > }
    finish{ diffuse 0.9 ambient 0.1 }
  }

#declare tx_rosa =
  texture{
    pigment{ color rgb < 1, 0.5, 1 > }
    finish{ diffuse 0.9 ambient 0.1 }
  }

#declare caixa =
        box {   < -2, -2, 0 >, < 2, 2, 1 >      }

#macro luzes(n, m)
        #if (n > 4)
                declare n = 4;
        #end
        #if (m > 4)
                declare m = 4;
        #end
        union{
                        #declare j = 0;
                        #while ( j < m )
                                #declare i = 0;
                                #while ( i < n )
                                        cylinder { < -1.5 + j, -1.5 + i, 1 >, < -1.5 + j, -1.5 + i, 1.05 >, 0.25
                                                #if ( mod(i,2) = 0 )
                                                        texture { tx_vermelho }
                                                #else
                                                        texture { tx_amarelo }
                                                #end
                                        }
                                        #declare i = i + 1;
                                #end
                                #declare j = j + 1;
                #end
        }
#end

#macro lateral(k)
        #if (k > 8)
                declare k = 8;
        #end
        #declare h = 0;
        #while ( h < k )
                box { < 2, -1.85 + h*0.5, 0.75 >, < 2.05, -1.6 + h*0.5, 0.25 >
                        #if ( mod(h,3) = 0 )
                                texture {tx_verde}
                        #else
                                texture {tx_rosa}
                        #end
                }
                #declare h = h + 1;
        #end
#end

luzes(3, 2)
lateral(5)

#include "eixos.inc"

        object { caixa texture { tx_azul } }

#include "camlight.inc"
#declare centro_cena = < 0.00, 0.00, 0.00 >;
#declare raio_cena = 4.0;
#declare dir_camera = < 14.00, 7.00, 6.00 >;
#declare dist_camera = 16.0;
#declare intens_luz = 1.00;
camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)