background {color rgb < 0.75, 0.80, 0.85 >} #declare tx_plastico = texture { pigment{ color rgb < 0.90, 0.90, 0.90 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tanque_base_cilindro = cylinder { <0, 0, -1>, <0, 0, 1>, 0.5 // center of one end, center of other end, radius open // remove end caps texture {tx_plastico} } #declare tanque_topo_esfera = sphere { <0, 0, 1.5>, 0.5 // , radius texture {tx_plastico} } #declare cano_horizontal_y = cylinder { <0, 0, 0>, <0, 0.5, 0>, 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_plastico} } #declare cano_vertical = cylinder { <0, 0, 0>, <0, 0, 0.5>, 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_plastico} } #declare tanque1 = union { object {tanque_base_cilindro} object {tanque_topo_esfera} object {cano_horizontal_y translate <0, 0.5, 0>} // object {cano_horizontal_y translate <0, -1, 0>} object {cano_vertical translate <0, 0, 2>} // } } #declare tanque_base_quadrado = box { <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5> // near lower left corner, far upper right corner texture {tx_plastico} } #declare tanque_topo_cone = cone { <0, 0, 0.5>, 0.4 // , center & radius of one end <0, 0, 1>, 0.2 // , center & radius of the other end texture {tx_plastico} } #declare cano_horizontal_x = cylinder { <0, 0, 0>, <0.5, 0, 0>, 0.1 // center of one end, center of other end, radius open // remove end caps texture {tx_plastico} } #declare tanque2 = union { object {tanque_base_quadrado} object {tanque_topo_cone} object {cano_horizontal_y translate <0, 0.2, 0.8>} object {cano_horizontal_y translate <0, -0.7, 0.8>} object {cano_horizontal_x translate <0.5, 0, 0>} } #declare tanque3 = union { object {tanque_base_cilindro} object {tanque_topo_cone translate <0, 0, 0.5>} object {cano_vertical translate <0, 0, 1.5>} object {cano_horizontal_y translate <0, 0.5, 0>} object {cano_horizontal_y translate <0, -1, 0>} } #declare arr = array[1000] #declare N = 0; #macro gera_tanques(m, n) #declare roleta1 = seed(m * n + 1234); #local pos_x = - m / 2; #local loop_m = 0; #while (loop_m < m) #local pos_y = - n / 2; #local loop_n = 0; #while (loop_n < n) #local rand_n = 3 * rand(roleta1); #switch (rand_n) #range (0, 1) #local q1 = ; #local q2 = ; #local q3 = ; #declare arr[N] = q1; #declare arr[N + 1] = q2; #declare arr[N + 2] = q3; #declare N = N + 3; union { object {tanque1 translate } } #break #range (1, 2) #local q1 = ; #local q2 = ; #local q3 = ; #declare arr[N] = q1; #declare arr[N + 1] = q2; #declare arr[N + 2] = q3; #declare N = N + 3; union { object {tanque2 translate } } #break #range (2, 3) #local q1 = ; #local q2 = ; #local q3 = ; #declare arr[N] = q1; #declare arr[N + 1] = q2; #declare arr[N + 2] = q3; #declare N = N + 3; union { object {tanque3 translate } } #break #end #local loop_n = loop_n + 1; #local pos_y = pos_y + 3; #end #local pos_x = pos_x + 3; #local loop_m = loop_m + 1; #end #end #declare nx = 7; #declare ny = 5; gera_tanques(nx, ny) #declare min_cena = < 1.5*(-nx-0.5), 1.5*(-ny-0.5), 0 >; #declare max_cena = < 1.5*(+nx-0.5), 1.5*(+ny-0.5), 1 >; #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 = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)