// tanques - mc937 data: 30/08/2023 //============================================================================ background{ color rgb < 0.500, 0.550, 0.600 > } //declarações #include "eixos.inc" #declare tx_tanque= texture{ pigment{ checker color rgb < 0.3, 0.3, 0.3 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 0.5 } #declare tx_tubo= texture{ pigment{ checker color rgb < 1, 0, 0 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 0.5 } //variáveis #declare roleta=seed(100); #declare pontos=array[9]; #declare N=0; //objetos #declare tanque_1=box{<-1,-1,-1>,<+1,+1,+1> texture{tx_tanque}} #declare tanque_2=sphere{<0,0,0>,1 texture{tx_tanque}} #declare tanque_3=cylinder{<0,0,-1>,<0,0,+1>, 1 texture{tx_tanque}} #declare tubo_superior=cylinder{<0,0,0>,<0,0,+0.5>, 0.2 texture{tx_tubo}} #declare tubo_lateral=cylinder{<0,0,0>,<0,+0.5,0>,0.2 texture{tx_tubo}} //macros #macro aleatorio() #local aleat=int((10*rand(roleta))-5); aleat #end #macro tanque_aleatori0() #local aleat=int((10*rand(roleta))-5); #end #macro gera_1(xx,yy) union{ object{tanque_1 translate<+xx,+yy,0>} object{tubo_superior translate<+xx,+yy,+1>} object{tubo_lateral translate<+xx,+yy+1,0>} object{tubo_lateral translate<+xx,+yy-2,0>} } #end #macro gera_2(xx,yy) union{ object{tanque_2 translate<+xx,+yy,0>} object{tubo_superior translate<+xx,+yy,+1>} object{tubo_lateral translate<+xx,+yy+1,0>} object{tubo_lateral translate<+xx,+yy-2,0>} } #end #macro gera_3(xx,yy) union{ object{tanque_3 translate<+xx,+yy,0>} object{tubo_superior translate<+xx,+yy,+1>} object{tubo_lateral translate<+xx,+yy+1,0>} object{tubo_lateral translate<+xx,+yy-2,0>} } #end #macro gera_tanques() // N= #end //cena gera_1(aleatorio(),aleatorio()) gera_2(aleatorio(),aleatorio()) gera_3(aleatorio(),aleatorio()) #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 10.0; #declare dir_camera = < -7.00, 14.00, 4.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera, z, intens_luz)