// background{ color rgb < 0.75, 0.80, 0.85 > } background{ color rgb 0.75*< 0.90, 0.80, 0.95 > } #declare tx_tanque = texture{ pigment{ color rgb < 0.7, 0.50, 0.40 > } finish{ diffuse 0.8 ambient 0.1 } } #declare tx_pecas = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #include "eixos.inc" #declare tanque1 = union{ box{ < +0.00, +0.00, +0.00 >, < +2.00, +2.00, +2.00 > texture{ tx_tanque } } cylinder{ < +1.00, +1.00, +2.00 >, < +1.00, +1.00, +4.00 >, 0.5 texture{ tx_tanque } } cylinder{ < +1.00, +1.40, +3.00 >, < +1.00, +1.75, +3.00 >, 0.1 texture{ tx_tanque } } cylinder{ < +1.00, +0.60, +3.00 >, < +1.00, +0.25, +3.00 >, 0.1 texture{ tx_tanque } } cylinder{ < +1.00, +1.00, +4.00 >, < +1.00, +1.00, +4.25 >, 0.1 texture{ tx_tanque } } } #declare tanque2 = union{ cylinder{ < +1.00, +1.00, +0.00 >, < +1.00, +1.00, +2.00 >, 1.0 texture{ tx_tanque } } cone{ < +1.00, +1.00, +2.00 >, 1.0, < +1.00, +1.00, +4.00 >, 0.5 texture{ tx_tanque } } cylinder{ < +1.00, +1.60, +3.00 >, < +1.00, +2.00, +3.00 >, 0.1 texture{ tx_tanque } } cylinder{ < +1.00, +1.1, +3.85 >, < +1.00, +1.5, +4.25 >, 0.1 texture{ tx_tanque } } cylinder{ < +1.00, +0.9, +3.85 >, < +1.00, +0.5, +4.25 >, 0.1 texture{ tx_tanque } } } #declare tanque3 = union{ cylinder{ < +1.00, +1.00, +0.00 >, < +1.00, +1.00, +3.00 >, 1.0 texture{ tx_tanque } } sphere{ < +1.00, +1.00, +3.00 >, 1.0 texture{ tx_tanque } } cylinder{ < +1.00, +1.9, +1.50 >, < +1.00, +2.25, +1.50 >, 0.1 texture{ tx_tanque } } cylinder{ < +1.00, +0.10, +1.50 >, < +1.00, -0.25, +1.50 >, 0.1 texture{ tx_tanque } } cylinder{ < +1.00, +1.00, +3.90 >, < +1.00, +1.00, +4.25 >, 0.1 texture{ tx_tanque } } } #declare roleta = seed( 31159 ); #declare ponta_cano = array[3000] #declare N = 0; #macro gera_tanques(m, n) #local i = 0; #local j = 0; #local n_tanque = 1; #while (i < m) #local j = 0; #while (j < n) #local n_tanque = 1 + int(3.0*rand(roleta)); #if (n_tanque = 1) object{ tanque1 translate < 5.0*i, 5.0*j, 0.0 > } #declare ponta_cano[N] = < (5.0*i + 1.00), (5.0*j + 1.75), +3.00 >; #declare ponta_cano[N+1] = < (5.0*i + 1.00), (5.0*j + 0.25), +3.00 >; #declare ponta_cano[N+2] = < (5.0*i + 1.00), (5.0*j + 1.00), +4.25 >; #declare N = N + 3; #end #if (n_tanque = 2) object{ tanque2 translate < 5.0*i, 5.0*j, 0.0 > } #declare ponta_cano[N] = < (5.0*i + 1.00), (5.0*j + 2.00), +3.00 >; #declare ponta_cano[N+1] = < (5.0*i + 1.00), (5.0*j + 1.50), +4.25 >; #declare ponta_cano[N+2] = < (5.0*i + 1.00), (5.0*j + 0.50), +4.25 >; #declare N = N + 3; #end #if (n_tanque = 3) object{ tanque3 translate < 5.0*i, 5.0*j, 0.0 > } #declare ponta_cano[N] = < (5.0*i + 1.00), (5.0*j + 2.25), +1.50 >; #declare ponta_cano[N+1] = < (5.0*i + 1.00), (5.0*j - 0.25), +1.50 >; #declare ponta_cano[N+2] = < (5.0*i + 1.00), (5.0*j + 1.00), +4.25 >; #declare N = N + 3; #end #local j = j + 1; #end #local i = i + 1; #end #end #declare nx = 7; #declare ny = 5; gera_tanques(nx,ny) #declare min_cena = < 5*(0-0.5), 5*(0-0.5), 0 >; #declare max_cena = < 5*(nx-0.5), 5*(ny-0.5), 5 >; #include "camlight.inc" #declare centro_cena = 0.5*(min_cena + max_cena); #declare raio_cena = 0.6*vlength(min_cena - max_cena); #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 2*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)