// Last edited on 2007-04-01 19:49:10 by stolfi
// Processed by remove-cam-lights

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

#declare raio = 2.000;

#declare tinta_Branca =
  texture {
    pigment { color rgb < 0.00, 0.0, 0.00 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.2 }
  }

#declare tinta_Preta = 
  texture {
    pigment { color rgb < 1.00, 1.00, 1.00 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.2 }
  }

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

#declare tinta_Verde = 
  texture {
    pigment { color rgb < 0.00, 1.00, 0.00 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.2 }
  }


#declare tinta_Azul = 
  texture {
    pigment { color rgb < 0.00, 0.00, 1.00 > }
    finish { diffuse 0.8 specular 0.2 roughness 0.005 ambient 0.2 }
  }


#declare casa =
   box { <0, 0, 0>,<1 ,1, 1>   
}
#declare tabuleiro = 
   #declare i = 0;  
   #declare j = 0;  
   #declare cor = 1;
   #while ( i < 20 )
       #while ( j < 20 )
   object {casa texture {#if (cor > 0) tinta_Branca #else tinta_Preta #end } translate<i, j, 0>}
          #declare j = j + 1;
          #declare cor = cor * -1;
        #end
        #declare j = 0;
        #declare i = i + 1;
        #declare cor = cor * -1;
   #end


#declare cone_rei =
    cone {
        <0.0, 0.0, 0.0>, 0.50 
        <0.0, 0.0, 1.0>, 0.25 
}  
#declare esfera_rei =
   sphere {
      < 0.00, 0.00, 0.00 >, 0.3       
   }
#declare coroa_rei =
     difference {
        cone {
           <0.0, 0.0, 0.0>, 0.15 
           <0.0, 0.0, 0.40>, 0.35 
        }

        cone {
           <0.0, 0.0, 0.0>, 0.13 
           <0.0, 0.0, 0.40>, 0.33 
        }
     }


#declare rei =
    union {
        object { cone_rei translate<0.0, 0.0, 1.0> }    
        object { esfera_rei translate<0.0, 0.0, 2.2> }
        object { coroa_rei  translate<0.0, 0.0, 2.5>}
    }




#declare cone_peao =
    cone {
        <0.0, 0.0, 0.0>, 0.50 
        <0.0, 0.0, 1.5>, 0.20 
}  

#declare cabeca_peao =
     cone {
        <0.0, 0.0, 0.00>, 0.10 
        <0.0, 0.0, 0.35>, 0.10 
}  

#declare peao =
    union {
        object { cone_peao  translate<0.0, 0.0, 1.0> }    
        object { cabeca_peao  translate<0.0, 0.0, 2.5>}
    }



#declare cone_torre =
    cone {
        <0.0, 0.0, 0.0>, 0.40 
        <0.0, 0.0, 1.0>, 0.00 
}  
#declare corpo_torre =
   cone {
      < 0.00, 0.00, 0.00 >, 0.3       
      < 0.00, 0.00, 1.00 >, 0.3       
   }

#declare base_torre =
   box { <-0.40, -0.40, 0.00>, <0.40, 0.40, 0.20> } 
         

#declare torre =
    union {
        object { base_torre translate<0.0, 0.0, 1.0> }    
        object { corpo_torre translate<0.0, 0.0, 1.20> }
        object { cone_torre  translate<0.0, 0.0, 2.20>}
    }







object {tabuleiro}





 
   #declare roleta = seed(79);
   #declare i = 0;  
   #declare j = 0;  
   #declare jogador = 1;
   #while ( i < 7 )
       #while ( j < 20 )
          #if ( int(rand(roleta)*4) = 1)
              object {rei texture{tinta_Azul} translate<0.5+i, 0.5+j, 0.0> }
              object {rei texture{tinta_Verde} translate<19.5-i,19.5-j, 0.0> }
          #end

          #if ( int(rand(roleta)*4) = 2)
              object {peao texture{tinta_Azul} translate<0.5+i, 0.5+j, 0.0> }
              object {peao texture{tinta_Verde} translate<19.5-i,19.5-j, 0.0> }
          #end

          #if ( int(rand(roleta)*4) = 3)
              object {torre texture{tinta_Azul} translate<0.5+i, 0.5+j, 0.0> }
              object {torre texture{tinta_Verde} translate<19.5-i,19.5-j, 0.0> }
          #end
   
          #declare j = j + 1;
          #declare cor = cor * -1;
        #end
        #declare j = 0;
        #declare i = i + 1;
   
   #end

// Original camera parameters:
// #local cam_ctr = <15.00,15.00,0.00>
// #local cam_vec = (<30.00,30.00,20.00>-<15.00,15.00,0.00>)
// #local cam_sky = z

#include "camlight.inc"
camlight(<15.00,15.00,3.00>,<10,10,10>,20.0,z,1.0)