// Last edited on 2004-01-23 02:30:08 by stolfi // ====================================================================== #declare NI = 3; #declare NJ = 2; //#declare NI = 5; //#declare NJ = 4; #declare ctr = <-30,0,0> + 0.5*30*< NI-1, NJ-1, 0 >; #declare camDir = < -50, 50, 140 >; camera { yelocation ctr + 1.80*camDir right -1.00*x up 0.75*y sky y look_at ctr } //=========================================== // Texturas #declare cor_cristal = <0.9,0.9,1>; #declare tx_cristal = texture{ finish{ ambient 0.1 diffuse 0.1 reflection 0.25 specular 1 roughness 0.001 } pigment{ color cor_cristal filter 1} }; #declare cor_espelho = <0,1,0>; // ====================================================================== // FONTES DE LUZ light_source { 10 * < 30, 40, +30 > color rgb 1.0 * < 1.00, 1.00, 1.00 > } light_source { 10 * < +50, -10, +50 > color rgb 0.4 * < 1.00, 1.00, 1.00 > } light_source { 10 * < -23, 8, +70 > color rgb 0.3 * < 1.00, 1.00, 1.00 > } // ====================================================================== // DESCRIÇÃO DA CENA background{ color rgb < 0.75, 0.80, 0.85 > } #declare raio = 2.000; #declare source = seed(10); #declare source_2 = seed(10*clock); #declare tinta_C = texture { pigment { color rgb < 1, 0, 0 > } finish { diffuse 0.9 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_A = texture { pigment { color rgb < 0.10, 0.80, 1.00 > } finish { diffuse 0.9 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_B = texture { pigment { color rgb < 1.00, 0.80, 0.10 > } finish { diffuse 0.9 specular 0.5 roughness 0.005 ambient 0.1 } } #declare lan_conn= union{ #declare i=0; #declare inc=1.17; #while(i<4.5) cylinder{ <0,0,0>, <20*cos(i),20*sin(i),0>, 0.5 texture {tinta_A}} //sphere{<20*cos(i),20*sin(i),0>,4 texture{tinta_B}} #declare i=i+inc; #end } #declare lan_hosts= union{ #declare i=0; #declare inc=1.17; #while(i<4.5) sphere{<20*cos(i),20*sin(i),0>,4 texture{tinta_B}} #declare i=i+inc; #end } #declare pkg_1 = cylinder{<0,0,0>, <0,3,0>, 5 texture{tinta_A}} #declare pkg_2 = box{<-3,-0.75,0>,<3,1.5,1> texture{tinta_B}} #declare pkg_3 = torus{3,1 texture{tinta_B}} #declare routers = union{ #declare i=0; #declare j=0; #while(i,4 texture{tinta_A}} #if(i, <30*i,0+30*j,0>,0.5 texture{tinta_A}} //--------------------Pacotes Horizontais ------------------ #declare r = rand(source); #declare off_set = -30+8+clock*22; #if(r<0.4) cylinder{, , 4 #if(r<0.2) texture{tinta_A}} #else texture{tinta_C}} #end #else #if(r>0.8) box{, texture{tinta_B}} #end #end //--------------------Pacotes Horizontais (fim)------------------ #end #if(j, <-30+30*i,30+30*j,0>,0.5 texture{tinta_A}} // ----------------- Pacotes Verticais ------------------------- #declare r = rand(source); #declare off_set = 5+clock*20; #if(r<0.4) cylinder{<-28+30*i,off_set+30*j,0>, <-28+30*i,off_set+2+30*j,0>, 3 #if(r<0.2) texture{tinta_A}} #else texture{tinta_C}} #end #else #if(r>0.8) sphere{<-28+30*i,off_set+30*j,0>,2.5 texture{tinta_B}} #end #end // ----------------- Pacotes Verticais (fim)------------------------- #end // ifs casador OK #if((i = 0) | (i = NI-1)) // apenas nas colunas extremas #declare r = rand(source_2); //-------------Construindo Lan Hosts--------------------- union{ object{lan_hosts} #if(i=0) #if(j=NJ-1) rotate +30*z #else rotate +120*z #end #end #if(i=NI-1) #if(j=NJ-1) rotate -60*z #else rotate -150*z #end #end translate<-30+30*i,0+30*j,0> } //----------- Construindo Lan_connections (casualmente)--------- #if(r>0.5) union{ object{lan_conn} #if(i=0) #if(j=NJ-1) rotate +30*z #else rotate +120*z #end #end #if(i=NI-1) #if(j=NJ-1) rotate -60*z #else rotate -150*z #end #end translate<-30+30*i,0+30*j,0> } #end #end// fim do if de apenas p_ colunas extremas // ifs casador OK #declare j=j+1; #end #declare i=i+1; #declare j=0; #end } // Aqui está a cena, finalmente: object{routers} //object{lan} //object{pkg_1}