// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2010-03-04 15:44:01 by stolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.50, 1.00 > } } #declare tx_chapeu = texture{ pigment{ color rgb < 0.10, 0.87, 0.40 > } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.0, 0.0, 0.0 >, color rgb < 1.00, 1.00, 1.00 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRIÇÃO DA CENA #declare raio = 2.000; // Partes da cena: #macro soldado(tipo) #declare headRadius = 0.3; #declare footHeight = 0.05; #declare footWidth = 0.14; union { // Feet box{ <-0.02, 0.1-footWidth/2, 0>, <0.3, 0.1+footWidth/2, footHeight> } box{ <-0.02, -0.1-footWidth/2, 0>, <0.3, -0.1+footWidth/2, footHeight> } // Legs cone{ <0, 0.1, 0>, 0.06, <-0, 0.1, 1>, 0.3 } cone{ <0, -0.1, 0>, 0.06, <0, -0.1, 1>, 0.3 } // Body cone{ <0, 0, 1>, 0.4, <0, 0, 2>, 0.2 } // Neck cone{ <0, 0, 2>, 0.07, <0, 0, 2.2>, 0.05 } // Head sphere{ <0, 0, 2.2+headRadius>, headRadius } // Hat #if (tipo = 1) // Sargentos têm chapeu cone{ <0, 0, 2.2+headRadius*2-0.1>, 0.25, <0, 0, 2.2+headRadius*2+0.15>, 0.2 texture{ tx_chapeu } } #end // Arms cylinder{ <0, 0, 1.8>, <0, 1, 1.8>, 0.1 } cylinder{ <0, 0, 1.8>, <0, -1, 1.8>, 0.1 } // Hands sphere{ <0, 1, 1.8>, 0.18 } sphere{ <0, -1, 1.8>, 0.18 } } #end #macro pelotao(columns, rows) #declare i = 0; union { #while(i < rows) #declare j = 0; #while(j < columns) #if ((i = 0 | i = rows-1) & (j = 0 | j = columns-1) | (i = int(rows/2) & j = int(columns/2))) // Gera sargento object{ soldado(1) translate } #else // Gera soldado object{ soldado(0) translate } #end #declare j = j + 1; #end #declare 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{ chao translate < 0,0,-5 > texture{ tx_xadrez } } object{ pelotao(5, 7) texture{ tx_plastico } } } #include "camlight.inc" #declare centro_cena = < 0.00, 2.50, 1.00 >; #declare raio_cena = 10.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 206.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)