// 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_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRI��O DA CENA #declare raio = 2.000; // Partes da cena: #declare peao = union { cylinder { <0, 0, 0>, // Center of one end <0, 0, 0.5>, // Center of other end 1 // Radius } cone { <0,0,0.5>, 0.8 <0,0,2>, 0.2 } sphere { < 0,0,2 >, 0.5 } texture { tx_plastico } } #declare rainha = union { cylinder { <0, 0, 0>, // Center of one end <0, 0, 0.3>, // Center of other end 1.2 // Radius } cylinder { <0, 0, 0.3>, // Center of one end <0, 0, 0.6>, // Center of other end 0.9 // Radius } cylinder { <0, 0, 0.6>, // Center of one end <0, 0, 0.9>, // Center of other end 0.6 // Radius } cylinder { <0, 0, 0.9>, // Center of one end <0, 0, 3>, // Center of other end 0.3 // Radius } cylinder { <0, 0, 2.5>, // Center of one end <0, 0, 2.7>, // Center of other end 0.5 // Radius } cone { <0,0,3>, 0.4 <0,0,3.3>, 0.8 } cone { <0,0,3.3>, 0.8 <0,0,3.8>, 0.5 } texture { tx_plastico } } #declare casa = object { cylinder { <0, 0, 0>, // Center of one end <0, 0, 0.2>, // Center of other end 1 // Radius } } #macro piso(andar, casas) #local raio_max = 10; #local raio_piso = raio_max - (andar*2); #local raio_piso_superior = raio_max - ((andar + 1)*2); #local raio_centro_casa = raio_piso - (raio_piso - raio_piso_superior)/2; #local angulo_casas = 360 / casas; union { object { cylinder { <0, 0, 0 + andar>, // Center of one end <0, 0, 1 + andar>, // Center of other end raio_max - (andar*2) // Radius } texture { tx_plastico } } #local casa_i = 0; #while (casa_i < casas) object { casa translate rotate angulo_casas*casa_i*z } #if (mod(andar, 2) = 0) #if (mod(casa_i, 2) = 0) object { peao translate rotate angulo_casas*casa_i*z } #end #else #if (mod(casa_i, 2) = 0) object { rainha translate rotate angulo_casas*casa_i*z } #end #end #local casa_i = casa_i + 1; #end } #end #macro tabuleiro(m, n) #local i = 0; union { #while (i != m) object { piso(i, n) } #local i = i + 1; #end } #end #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #include "eixos.inc" // Aqui est� a cena, finalmente: union{ object{ eixos(3.00) } object{ tabuleiro(4, 8) } object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 15.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)