// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-09-20 21:19:48 by stolfilocal // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.90, 0.80, 0.85 > } #declare corPreta = texture{ pigment { color rgb <0.2,0.2,0.2>}} #declare corBranca = texture{ pigment { color rgb <0.8,0.8,0.8>}} #declare tx_fosca_preta = texture{ pigment{ color rgb < 0.1, 0.1, 0.1 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca_cinza = texture{ pigment{ color rgb < 0.3, 0.3, 0.3 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.1, 0.1, 0.1 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } #declare tx_fosca = texture{ pigment{ color rgb < 0.80, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_bug = texture{ pigment{ color rgb < 1.00, 0.40, 0.10 > } finish{ diffuse 0.2 ambient 0.8 } } #declare peao = union { cylinder { <0, 0, 0>, <0, 0, 0.3>, 0.75// center of one end, center of other end, radius texture{tx_fosca_preta} } cone { <0, 0, 0.3>, 0.5 // , center & radius of one end <0, 0, 1.5>, 0 // , center & radius of the other end texture{tx_fosca_cinza} } } #declare rainha = union { cylinder { <0, 0, 0>, <0, 0, 0.3>, 0.75// center of one end, center of other end, radius texture{tx_fosca_preta} } cone { <0, 0, 0.3>, 0.5 // , center & radius of one end <0, 0, 1.5>, 0 // , center & radius of the other end texture{tx_xadrez} } sphere{ < 0,0,1.5 >, 0.35 texture{tx_fosca}} } #declare casa = cylinder { <0, 0, 0>, <0, 0, 0.1>, 1// center of one end, center of other end, radius } // Funão que deveria criar o tabuleiro #macro create_board(n, m) union { #for (i, 0, n-1) #local casaColor = corBranca; #local angles = i*360/n; #local X = m*cos(angles); #local Y = m*sin(angles); #if(mod(i,2)=0) #local casaColor = corBranca; #else #local casaColor = corPreta; #end object{casa translate texture{casaColor}} #end #for (j, 0, n-1) #local angle2 = j*360/n; #local X2 = m*cos(angle2); #local Y2 = m*sin(angle2); #local element = peao object{element translate} #if(mod(j,3)=1) #local element = peao #end #if(mod(j,2)=2) #local element = rainha #end #end } #end #include "eixos.inc" #local nfileiras = 7; #local ncasas = 9; union{ // object{eixos(3.00) } // object{casas} // cylinder{ <0,0,-1.0>, <0,0,-0.1>, ncasas texture{ tx_bug } } object{create_board(nfileiras, ncasas)} object{peao translate ncasas*<1.4,+0.1,0>} object{rainha translate ncasas*<1.4,-0.1,0>} } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 2.00 >; #declare raio_cena = 1.4*ncasas; #declare dir_camera = < 14.00, 7.00, 4.00 >; // #declare dir_camera = < -2.00, 7.00, 4.00 >; #declare dist_camera = 8*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)