// CORES E TEXTURAS background{ color rgb < 1.00, 1.00, 1.00 > } #declare tx_peao = texture{ pigment{ color rgb < 0.00, 0.85, 0.10 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_dama = texture{ pigment{ color rgb < 1.00, 0.05, 0.10 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_chao = texture{ pigment{ color rgb < 0.50, 0.50, 0.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_tabuleiro = texture{ pigment{ color rgb < 0.50, 0.70, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_casa = texture{ pigment{ color rgb < 1.00, 0.50, 0.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare peao = union{ sphere{ < 0,0,0 >, 0.50 } sphere{ < 0.2,0,0 >, 0.50 } sphere{ < 0.4,0,0 >, 0.50 } texture{ tx_peao } } #declare dama = union{ sphere{ < 0,0,0 >, 0.50 } sphere{ < 0.2,0,0 >, 0.50 } sphere{ < 0.4,0,0 >, 0.50 } sphere{ < 0.2,0.2,0 >, 0.50 } sphere{ < 0.2,-0.2,0 >, 0.50 } texture{ tx_dama} } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #declare tabuleiro = union{ cylinder{ < 0.00, 0.00, -0.10 >, < 0.00, 0.00, +0.10 >, 4.00 texture{ tx_tabuleiro } } } #declare casa = sphere{ < 0.00, 0.00, 0.00 >, 0.50 texture{ tx_casa } } #macro jogo(m, n) #declare index_m = 1; #while (index_m <= m) #declare index_n = 1; union{ object{ tabuleiro translate < 0,0,index_m*2.5 > } } #while (index_n <= n) union{ object{ casa translate < index_n*0.2,index_n*0.5,index_m*2.5 > } } #if (index_n = index_m) #if (mod(index_m,2) = 0) union{ object{ dama translate < index_n*0.2,index_n*0.5,index_m*2.5 > } } #else union{ object{ peao translate < index_n*0.2,index_n*0.5,index_m*2.5 > } } #end #end #declare index_n = index_n + 1; #end #declare index_m = index_m + 1; #end #end #include "eixos.inc" #local nfileiras = 6; #local ncasas = 8; union{ // object{ eixos(8.00) } object{ chao translate < 0,0,-5 > texture{ tx_chao } } jogo(nfileiras, ncasas) union{ object{ eixos(2) } object{ peao } translate <5, 3, 4 > } union{ object{ eixos(2) } object{ dama } translate <5, -3, 4 > } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.25*(nfileiras + 1) >; #declare raio_cena = 1.5*nfileiras + 5; #declare dir_camera = < 6.00, 4.00, 3.00 >; #declare dist_camera = 7*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)