// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2020-09-30 19:57:13 by jstolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 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, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 1, 0, 0 >, color rgb < 0, 0, 0 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } #declare tx_table_row = texture { pigment { // Define the background color color rgb <0.8, 0.8, 0.8> } finish { // Adjust the reflectivity and other surface properties ambient 0.3 diffuse 0.7 specular 0.2 reflection 0.3 } } #declare tx_table_row_border = texture { pigment { // Use a wood-like pattern for the border wood turbulence 0.5 color_map { [0.0 color rgb <0.4, 0.2, 0>] // Dark wood color [0.5 color rgb <0.4, 0.2, 0>] // Dark wood color [1.0 color rgb <0.8, 0.4, 0>] // Light wood color } } finish { ambient 0.2 diffuse 0.8 } } // Define a wood-like texture #declare tx_place = texture { pigment { checker color rgb <0.2, 0.2, 0.2>, color rgb <0.8, 0.8, 0.8> scale 0.5 // Adjust the scale of the checkers pattern } finish { ambient 0.2 diffuse 0.8 } } // Define a chess piece texture (white marble) #declare tx_peao = texture { pigment { marble color_map { [0.0 color rgb <1, 1, 1>] // White color [0.7 color rgb <0.8, 0.8, 0.8>] // Light gray color } scale 0.5 // Adjust the scale of the marble pattern } finish { ambient 0.2 diffuse 0.8 specular 0.9 } } #declare tx_dama = texture { pigment { marble color_map { [0.0 color rgb <0, 0, 0>] // Black color [0.7 color rgb <0.1, 0.1, 0.1>] // Dark gray color } scale 0.5 // Adjust the scale of the marble pattern } finish { ambient 0.2 diffuse 0.8 specular 0.9 } } // ====================================================================== // DESCRI��O DA CENA #declare raioSust = 0.25; #declare raioPoste = 0.5; #declare raioPerna = 0.5; // Partes da cena: #declare TableRow = cylinder{ < 0, 0, 0 >, < 0, 0, 0.5 >, 4 } #declare TablePlace = cylinder{ < 0, 0, 0.5 >, < 0, 0, 0.75 >, 1 } #declare PeaoBase = cylinder{ < 0, 0, 0.75 >, < 0, 0, 1.25>, 0.5 } #declare PeaoBody = cone { <0, 0, 1.25>, 0.5 // , center & radius of one end <0, 0, 2.25>, 0.1 // , center & radius of the other end } #declare PeaoHead = sphere { <0, 0, 2.25>, 0.25 // , radius } #declare DamaBase = box { <-0.4, -0.4, 0.75>, <0.4, 0.4, 1.3> // near lower left corner, far upper right corner } #declare DamaBody = cylinder{ < 0, 0, 1.3 >, < 0, 0, 2.3>, 0.2 } #declare DamaEnfeite = cone { <0, 0, 2.3>, 0.5 // , center & radius of one end <0, 0, 1.8>, 0 // , center & radius of the other end } #declare DamaHead = cone { <0, 0, 2.3>, 0.5 // , center & radius of one end <0, 0, 3.3>, 0 // , center & radius of the other end } #macro peao(position) union{ object { PeaoBase translate position texture { tx_peao } } union{ object { PeaoBody translate position texture { tx_peao } } object { PeaoHead translate position texture { tx_peao } } } } #end #macro dama(position) union{ object { DamaBase translate position texture { tx_dama } } union{ object { DamaBody translate position texture { tx_dama } } object { DamaEnfeite translate position texture { tx_dama } } } object { DamaHead translate position texture { tx_dama } } } #end #macro tabuleiro(m, n) union{ #declare m0 = 1; #declare baseRadius = 4; #while (m0 <= m) object{ TableRow texture { tx_table_row } } #declare n0 = 1; #while (n0 <= n) #declare angle_n0 = 2 * pi * (n0 / n); #declare x_n0 = m0 * baseRadius * cos(angle_n0); #declare y_n0 = m0 * baseRadius * sin(angle_n0); object{ TablePlace translate texture { tx_place } } #if (mod(m0, 2) = 0 & n0 = 1) object { dama() } #else #if (mod(m0, 2) = 0 & n0 = n) object { peao() } #else #if (mod(n0, 2) = 0) object { peao() } #end #end #end #declare n0 = n0 + 1; #end #declare m0 = m0 + 1; #end } #end #include "eixos.inc" // Aqui est� a cena, finalmente: union{ object{ tabuleiro(3, 4) scale <0.5, 0.5, 0.5> } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 6.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)