background{ color rgb < 0.75, 0.80, 0.95 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.40, 0.70, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.60 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 1.00, 1.00 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 1.00, 1.00 > ambient 0.1 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.00, 0.00, 0.00 >, color rgb < 1.00, 1.00, 1.0 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } ////////////////////// //peças e tabuleiro #declare r_cilindro = 0.4; #declare r_bola = 0.4; #declare peao = union { cone { <0, 0, 0>, 0.5 // , center & radius of one end <0, 0, 1>, 0.0 // , center & radius of the other end texture{ tx_plastico } } cylinder { <0, 0, 1>, <0, 0, 1.1>, r_cilindro // center of one end, center of other end, radius texture{ tx_plastico } } sphere { <0, 0, 1.5>, r_bola // , radius texture{ tx_plastico } } } #declare dama = union { cone { <0, 0, 0>, 0.5 // , center & radius of one end <0, 0, 1>, 0.0 // , center & radius of the other end texture{ tx_plastico } } sphere { <0, 0, 1.4>, r_bola // , radius texture{ tx_plastico } } cone { <0, 0, 2.5>, 0.3 // , center & radius of one end <0, 0, 1.8>, 0.0 // , center & radius of the other end texture{ tx_plastico } } } #declare casas = cylinder { <0, 0, 0>, <0, 0, 0.3>, 0.8 // center of one end, center of other end, radius texture{ tx_fosca } } #macro criar_tabuleiro(m, n) union{ #local n_casas_coluna = n/m; #local n_casas_restantes = n; #local j = 1; #while(n_casas_restantes > 0) #local i = 0; #while(i < m & n_casas_restantes > 0) #local Y = sin(radians((360/m)*i)); #local X = cos(radians((360/m)*i)); object{casas translate <3*j*X, 3*j*Y, 0>} #if(mod(i+1,3) = 0) object{peao translate <3*j*X, 3*j*Y, 0.3>} #else #end #if(i = 3 | i = 6) object{dama translate <3*j*X, 3*j*Y, 0.3>} #else #end #local i = i + 1; #local n_casas_restantes = n_casas_restantes - 1; #end #local j = j+1; #end } #end #include "eixos.inc" //cena union{ object{ eixos(3.00) } object{criar_tabuleiro(9, 27)} } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 3.00 >; #declare raio_cena = 16.0; #declare dir_camera = < 300.00, 300.00, 200.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)