// ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.0, 1.0, 1.0 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRICAO DA CENA #declare raio = 1.000; #declare space = 2.000; // Partes da cena: // tank 01 #declare column_01 = cylinder{ < 0, 0.00, 0.00 > < 0, 0.00, 1.50 >, raio * 0.5 texture{ tx_fosca } } #declare roof_01 = sphere{ < 0, 0.00, 2.00 > raio texture{ tx_fosca } } #declare tank_1 = union{ object{ column_01 } object{ roof_01 } } // tank 02 #declare column_02 = box{ < 1.00 , 1.00, 1.50 >, < -1.00 , -1.00, 0.00 > texture{ tx_fosca } } #declare roof_02 = sphere{ < 0, 0.00, 1.50 > raio * 0.5 texture{ tx_fosca } } #declare tank_2 = union{ object{ column_02 } object{ roof_02 } } // tank 03 #declare column_03 = cylinder{ < 0, 0.00, 0.00 > < 0, 0.00, 1.50 >, raio texture{ tx_fosca } } #declare roof_03 = sphere{ < 0, 0.00, 1.50 > raio * 0.5 texture{ tx_fosca } } #declare tank_3 = union{ object{ column_03 } object{ roof_03 } } // tocos #declare toco_1 = cylinder{ < 0, 0.0, 0.50 > < 0, 1.5, 0.50 >, raio * 0.2 texture{ tx_fosca } } #declare toco_2 = cylinder{ < 0, 0.0, 0.50 > < 1.5, 0, 0.50 >, raio * 0.2 texture{ tx_fosca } } #declare toco_3 = cylinder{ < 0, 0.0, 0.50 > < 0, -1.5, 0.50 >, raio * 0.2 texture{ tx_fosca } } #declare toco_4 = cylinder{ < 0, 0.0, 0.50 > < -1.5, 0, 0.50 >, raio * 0.2 texture{ tx_fosca } } #declare toco_5 = cylinder{ < 0, 0, 0.50 > < 0, 0, 4.00 >, raio * 0.2 texture{ tx_fosca } } #declare cano_v = cylinder{ < 0, 0, 0.0 > < 0, 0, 5.00 >, raio * 0.2 texture{ tx_fosca } } // teste #declare tanks = array[3] { tank_1, tank_2, tank_3 } #declare tocos = array[5] { toco_1, toco_2, toco_3, toco_4, toco_5 } #declare pos_toco = array[5] { < 0, 1.5, 0.50 >, < 1.5, 0, 0.50 >, < 0, -1.5, 0.50 >, < -1.5, 0, 0.50 >, < 0, 0, 0.50 > } // object { tank_1 translate <0, -5> } // object { tank_2 translate <0, 0> } // object { tank_3 translate <0, 5> } // object { toco_1 translate <0, 0> } // object { toco_2 translate <0, 0> } // object { toco_3 translate <0, 0> } // object { toco_4 translate <0, 0> } // object { toco_5 translate <0, 0> } #macro gera_tanques(lins, cols, pos_tocos) #local spac = 5; #local idx_pos_tocos = 0; #local TankSeed = seed(220792); #for (i,0,cols - 1) #for (j,0,lins - 1) object { tanks[rand(TankSeed) * 3] translate } #declare tmp_tocos = array[3] { rand(TankSeed) * 5, rand(TankSeed) * 5, rand(TankSeed) * 5 } #for (idx,0,2) object { tocos[tmp_tocos[idx]] translate } #declare pos_tocos[idx_pos_tocos] = pos_toco[tmp_tocos[idx]] + ; #local idx_pos_tocos = idx_pos_tocos + 1; #end #end #end #end #macro gera_canos(n, pos_tocos) #local PipeSeed = seed(220792); #for (i, 0, n - 1) object { cano_v translate pos_tocos[i] } #end #for (i, 0, n - 1) #local tmp_pos = pos_tocos[i]; #local tmp_pos_idx = rand(PipeSeed) * n; #declare pos_tocos[i] = pos_tocos[tmp_pos_idx]; #declare pos_tocos[tmp_pos_idx] = tmp_pos; #end #for (i, 0, floor(n / 2) - 1) object{ cylinder{ pos_tocos[i] + < 0, 0, 5.0 > pos_tocos[floor(n / 2) + i] + < 0, 0, 5.0 >, raio * 0.2 texture{ tx_fosca } } } #end #end #include "eixos.inc" #declare tqmax = 1000; // Num max de tanques. #declare pos_tocos = array[3*tqmax]; #declare nfilas = 7; #declare ncols = 11; gera_tanques(nfilas, ncols, pos_tocos) gera_canos(3*nfilas*ncols, pos_tocos) #declare tam_cena = < 5*ncols, 5*nfilas, 5 >; #include "camlight.inc" #declare centro_cena = 0.5*tam_cena; #declare raio_cena = 0.6*vlength(tam_cena); #declare dir_camera = < 45.00, 45.00, 45.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera, z, intens_luz)