// Last edited on 2004-01-23 00:16:41 by stolfi #declare numSlot=4; #declare slot = floor(clock*numSlot); #declare tSlot = clock*numSlot - slot; #declare intLuz = (1+sin(2*pi*(tSlot+0.75))); #declare centro = <0,-50,0>; #declare raio = 300; #declare posCamera = centro + raio*; // ====================================================================== #declare ctr = centro; #declare camDir = (posCamera) - (centro); camera { location ctr + 1.00*camDir right -1.20*x up 0.90*y sky z look_at ctr } // ====================================================================== // FONTES DE LUZ light_source { < 0.0, 0.0, 0.0 > // Posição da lâmpada. color rgb intLuz* < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { < 0.0, 20.0, 20.0 > // Posição da lâmpada. color rgb intLuz *< 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { < 0.0, -20.0,-20.0 > // Posição da lâmpada. color rgb intLuz *< 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA background{ color rgb < 0.3, 0.2, 0.1 > } #declare vidro = texture { pigment { color rgb < 1.0, 1.0, 1.0 > filter 0.9 } finish { diffuse 0.1 reflection 0.25 specular 0.25 roughness 0.001 ambient 0.1 } } #declare ce1 = <0.8, 0.5, 0.2>; #declare espelho1 = texture { pigment { color rgb ce1} finish { diffuse 0.2 specular 0.20 roughness 0.05 ambient 0.05 reflection ce1} } #declare ce2 = <0.2, 0.8, 0.5>; #declare espelho2 = texture { pigment { color rgb ce2} finish { diffuse 0.2 specular 0.20 roughness 0.05 ambient 0.05 reflection ce2} } #declare ce3 = <0.5, 0.2, 0.8>; #declare espelho3 = texture { pigment { color rgb ce3} finish { diffuse 0.2 specular 0.20 roughness 0.05 ambient 0.05 reflection ce3} } #declare verde=texture{ pigment { color rgb <0.0,1.0,0.0>} finish { diffuse 0.95 specular 0.20 roughness 0.05 ambient 0.05} } #declare noh = sphere { <0, 0, 0> 10 } #declare pacote = sphere { <0, 0, 0> 3 texture {verde} } #declare l = 80; #declare h = l*sqrt(3)/2; #declare d = l*sqrt(6)/3; #declare tx = 4; #declare ty = 4; #declare tz = 4; #macro maresta( p1, p2 , c) cylinder {p1 p2 3 texture{vidro}interior {ior 1.5}} #declare q=rand(seedPacote); #if(q<0.2) object{pacote translate ((tSlot)*p1+(1-tSlot)*p2) } #end #end #macro mposicao(i, j, k) #declare p=<(k-tx/2)*d, (j-ty/2 + 1/2*(mod(i,2)-mod(k,2)) )*l, (i-tz/2 + 1/2*mod(k,2))*h>; #end #declare s=seed(0); #declare seedPacote = seed(slot); union { #declare i=0; #while(i=0.67) object{noh translate p texture{espelho1}} #end #if((r<0.67)*(r>=0.33)) object{noh translate p texture{espelho2}} #else object{noh translate p texture{espelho3}} #end mposicao(i,j,k) #declare p0=p; mposicao(i,j+1,k) #declare p1=p; mposicao(i+1,j-1+mod(i,2),k) #declare p2=p; mposicao(i+1,j+mod(i,2),k) #declare p3=p; mposicao(i,j,k-1) #declare p4=p; mposicao(i-1,j,k-1) #declare p5=p; mposicao(i,j-1,k-1) #declare p6=p; #if(j+1) #end #if(i+10) maresta(p0, p2, <0,1,0>) #end #if(j+mod(i,2)) #end #end #if(k>0) maresta(p0, p4, <0,0,0>) #if(i>0) maresta(p0, p5, <0,0,0>) #end #if(j>0) maresta(p0, p6, <0,0,0>) #end #end #declare k=k+1; #end #declare j=j+1; #end #declare i=i+1; #end }