// Editado por Edson Daniel dos Santos Mani Junior, // RA 104832. // Exemplo de arquivo de descricao de cena para POV-ray // Feito por Stolfi #include "eixos.inc" #include "camlight.inc" #declare centro_cena = < 0.00+3*clock, 0.00+3*clock, 0.00-(2*clock) >; #declare raio_cena = 7.0; #declare dir_camera = < 0, -10, 90 >; #declare dist_camera = 5.0-(2*clock); #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz) // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.50, 0.50, 0.50 > } #declare vermelho_fosco = texture { pigment{ color rgb <1.00, 0.00, 0.00>} finish { diffuse 1 specular 0.2 } } #declare verde_fosco = texture { pigment{ color rgb <0.00, 1.00, 0.00>} finish { diffuse 1 specular 0.2 } } #declare azul_fosco = texture { pigment{ color rgb <0.00, 0.00, 1.00>} finish { diffuse 1 specular 0.2 } } #declare branco_fosco = texture { pigment{ color rgb <1.00, 1.00, 1.00>} finish { diffuse 1 specular 0.2 } } #declare azul_fosco = texture { pigment{ color rgb <0.00, 0.00, 1.00>} finish { diffuse 1 specular 0.2 } } #declare cinza_fosco = texture { pigment{ color rgb <0.40, 0.40, 0.40>} finish { diffuse 1 specular 0.2 } } #declare marrom_fosco = texture { pigment{ color rgb <0.60, 0.30, 0.20>} finish { diffuse 1 specular 0.2 } } #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 } #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 } } // ====================================================================== // DESCRIÇÃO DA CENA #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #declare roleta = seed(417); // Macros do Lab 07 #macro bit( est, prob ) union{ #if ( est >= 1 ) /* Bit 1 maior em Y*/ #if( rand(roleta) < prob) object{ sphere{ <0,0,0>,0.2 texture{ verde_fosco } } } #else object{ box{ <-0.1,-0.25,0>, <0.1,0.25,0.1> } } #end #else #if( rand(roleta) < prob) object{ sphere{ <0,0,0>,0.2 texture{ tx_xadrez } } } #else object{ box{ <-0.25,-0.1,0>, <0.25,0.1,0.1> } rotate<0,0,90*est> } // A cada 0.1 temos um angulo de 9graus #end #end } #end //Macro minha #macro fileira(nbits,valor,prob) union{ #local i=1; #local r=int(valor); #local f= valor-r; #while ( i <= nbits) #local vb = mod(r,2); #if(vb = 0) object { bit(f,prob) translate } #local f = 0; #else object { bit(1-f,prob) translate } #end #local valor = int(valor/2); #local r =int(valor); #local i = i + 1; #end } #end // abaco de vdd #declare valores = array[10] ; #declare valores[0] = (1-clock)*2+clock*3; #declare valores[1] = (1-clock)*5+clock*6; #declare valores[2] = (1-clock)*2.5+clock*3.5; #declare valores[3] = (1-clock)*4.5+clock*5.5; #declare valores[4] = (1-clock)*2.1+clock*2.5; #declare valores[5] = (1-clock)*10.5+clock*13.5; #declare valores[6] = (1-clock)*12.5+clock*23.5; #declare valores[7] = (1-clock)*2.4+clock*3; #declare valores[8] = (1-clock)*7.5+clock*8.5; #declare valores[9] = (1-clock)*2.5+clock*3.5; #macro abaco(m,n,valor,prob) #local j = 1 ; union{ object{ box{ <0.5,0,0> , texture{tx_vidro} } } #while ( j <= m ) object { fileira(n,valor[j-1],prob) translate <0,j-0.4,0> } #local j = j + 1; #end } #end /*Aqui comeca a cena. */ union { object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } //object{ eixos(3.00) } object { abaco(5,5,valores,0.3) } //object{ fileira(5,2.5,0) } }