// ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_peao = 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_rainha = texture{ pigment{ color rgb < 0.40, 0.10, 0.30 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_xadrez = texture { pigment { checker color rgb <0.2, 0.2, 0.2>, color rgb <0.8, 0.8, 0.8> scale 1 } finish { ambient 0.2 diffuse 0.8 } } // ====================================================================== // DESCRICAO DA CENA #macro baseVazia(position) union{ object{ cylinder{ position, position + <0,0,1>, 3 texture{ tx_xadrez } } } } #end #macro hiperrainha(position) union{ object{ cylinder{ position + <1,1,-1>, position + <1,1,0>, 3 texture{ tx_xadrez } } } object{ box { position, position + <2,2,2> } texture{ tx_rainha } } object{ sphere { position + <1,1,3>, 1 } texture{ tx_rainha } } object{ cone{ position + <1,1,4>, 1 position + <1,1,5>, 0 texture{ tx_rainha } } } } #end #macro hiperpeao(position) union{ object{ cylinder{ position + <0,1,-1>, position + <0,1,0>, 3 texture{ tx_xadrez } } } object{ cone{ position, 1 position + <0,0,2>, 0 texture{ tx_peao } } } object{ cone{ position + <0,2,0>, 1 position + <0,2,2>, 0 texture{ tx_peao } } } object{ box { position + <-1,-0.5,2>, position + <1,3,3> } texture{ tx_peao } } object{ sphere { position + <0,1.25,4>, 1 } texture{ tx_peao } } } #end #include "eixos.inc" // Aqui este a cena, finalmente: #declare nfileiras = 4; #declare ncasas = 12; #declare raio = 10; union { #declare IndexM = 1; #while(IndexM <= nfileiras) #declare IndexN = 1; #while(IndexN <= ncasas) #declare xx = IndexM * raio * cos(2 * 3.14 * (IndexN / ncasas)); #declare yy = IndexM * raio * sin(2 * 3.14 * (IndexN / ncasas)); #if(mod(IndexM, 2) = 0) #if(mod(IndexN, 3) != 0) object { hiperrainha() } #else object { baseVazia() } #end #else #if(mod(IndexN, 2) = 0) object { hiperpeao() } #else object { baseVazia() } #end #end #declare IndexN = IndexN + 1; #end #declare IndexM = IndexM + 1; #end } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 12*nfileiras + 4; #declare dir_camera = < 1.00, 2.00, 1.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)