// Last edited on 2004-01-22 11:47:57 by stolfi #include "colors.inc" #include "textures.inc" // Exemplo de arquivo de descricao de cena para POV-ray #declare TAM = 5; // ====================================================================== #declare ctr = 3* + <0,0,4>; // sphere{ ctr,2 pigment{color rgb <1,0,1>} finish{diffuse 0.2 ambient 0.8}} #declare camDir = < -3.00, -15.00, 20.00 >; camera { location ctr + 1.05*camDir right -1.00*x up 0.75*y sky z look_at ctr } // ====================================================================== // FONTES DE LUZ light_source { 10 * < 5.00, 22.00, 40.00 > // Posição da lâmpada. color rgb 0.4*< 1.00, 1.00, 1.00 > // Intensidade e cor da luz. } light_source { 10 * < -5.00, 22.00, 40.00 > // Posição da lâmpada. color rgb 0.6*< 1.00, 1.00, 1.00 > // Intensidade e cor da luz. } light_source { 10 * < -12.00, 00.00, 40.00 > // Posição da lâmpada. color rgb 1.0*< 1.00, 1.00, 1.00 > // Intensidade e cor da luz. } // ====================================================================== // DESCRIÇÃO DA CENA background { color rgb < 0.68, 1.00, 0.65 > } #declare plano_xy = plane { < 0, 0, 1 >, 0 } #declare Semente = seed ( 12345 ); #declare rede = union { #declare Y = 1; #while( Y <= TAM ) #declare X = TAM - Y + 1; #while( X <= TAM + Y - 1 ) union { sphere { < 0, 0, 0 >, 0.5 texture { // EsferaT pigment { color rgb } finish { ambient 0.1 diffuse 0.9 phong 0.2 } } } #if ( Y < TAM ) cylinder { < 0, 0, 0 >, < 0, 3, 0>, 0.1 texture { pigment { color rgb } finish { ambient 0.1 diffuse 0.9 phong 0.2 } } } #if ( X = TAM - Y + 1 ) cylinder { < 0, 0, 0 >, < -3, 3, 0>, 0.1 texture { pigment { color rgb } finish { ambient 0.1 diffuse 0.9 phong 0.2 } } } #end #if ( X = TAM + Y - 1 ) cylinder { < 0, 0, 0 >, < 3, 3, 0>, 0.1 texture { pigment { color rgb } finish { ambient 0.1 diffuse 0.9 phong 0.2 } } } #end #if ( rand(Semente) < 0.6 ) box { < 0.20, 0.20, 0.20>, < -0.20, -0.20, -0.20> pigment { color rgb } translate < 0, 3 * rand(Semente), 0> } #end #end #if ( X < TAM + Y - 1 ) cylinder { < 0, 0, 0 >, < 3, 0, 0>, 0.1 texture { pigment { color rgb } finish { ambient 0.1 diffuse 0.9 phong 0.2 } } } #if ( rand(Semente) < 0.4 ) box { < 0.20, 0.20, 0.20>, < -0.20, -0.20, -0.20> pigment { color rgb } translate < 3 * rand(Semente), 0, 0> } #end #end translate < 3 * X, 3 * Y, 4> } #declare X = X + 1; #end #declare Y = Y + 1; #end } // Aqui está a cena, finalmente: union { object { plano_xy pigment { checker rgb < 0.30, 0.30, 0.40 >, < 0.50, 0.50, 0.60 > } } object { rede } }