// Last edited on 2004-01-22 11:14:02 by stolfi // ====================================================================== #declare ctr = < 0, 10, 0 >; #declare camDir = < 30, -70, 220 >; camera { location ctr + 0.55*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>; #declare tx_espelho = texture{ pigment {rgb cor_espelho} finish{ ambient 0.05 diffuse 0.05 reflection cor_espelho specular 0.2 roughness 0.05 } pigment{ color cor_cristal filter 1} } // ====================================================================== // FONTES DE LUZ light_source { 10 * < 0, 40, 30.0 > // Posição da lâmpada. color rgb 1.2 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { 10 * < +50.0, -10.0, +10.0 > // Posição da lâmpada. color rgb 0.8 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { 10* < -23, 8, -10 > // Posição da lâmpada. color rgb 2 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA background{ color rgb < 0.75, 0.80, 0.85 > } #declare raio = 2.000; #declare source = seed(1); #declare tinta_A = texture { pigment { color rgb < 0.10, 0.80, 1.00 > } finish { diffuse 0.5 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.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare lan= 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 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<3) #while(j<2) sphere {<-30+30*i,0+30*j,0>,4 texture{tinta_A}} #if(i<2) cylinder{<-30+30*i,0+30*j,0>, <30*i,0+30*j,0>,0.5 texture{tinta_A}} #declare r = rand(source); #if(r<0.4) cylinder{<-15+30*i,3+30*j,0>, <-15+30*i,3+3+30*j,0>, 4 texture{tinta_A}} #else #if(r>0.8) box{<-3-15+30*i,3+30*j,0>, <3-15+30*i,3+3+30*j,2> texture{tinta_B}} #end #end #end #if(j<1) cylinder{<-30+30*i,0+30*j,0>, <-30+30*i,30+30*j,0>,0.5 texture{tinta_A}} #declare r = rand(source); #if(r<0.4) cylinder{<-28+30*i,15+30*j,0>, <-28+30*i,2+15+30*j,0>, 3 texture{tinta_A}} #else #if(r>0.8) sphere{<-28+30*i,15+30*j,0>,2.5 texture{tinta_B}} #end #end #end // ifs casador OK #if(i!=1) // apenas nas colunas extremas #declare r = rand(source); #if(r>0.5) union{ object{lan} #if(i=0) #if(j=1) rotate 30*z #else rotate 120*z #end #end #if(i=2) #if(j=1) rotate -60*z #else rotate -150*z #end #end translate<-30+30*i,0+30*j,0> } #end #end// find 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}