#include "eixos.inc" background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_branco = texture{ pigment{ color rgb < 1.00, 1, 1 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_cinza = texture{ pigment{ color rgb < 0.7, 0.7, 0.7 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_verde = texture{ pigment{ color rgb < 0.3, 0.8, 0. > } finish{ diffuse 0.9 ambient 0.1 } } #declare caixa = box { < -1, -1, 0 >, < 1, 1, 1> } #declare conSection = cone { <0, 0, 0>, 1 <0, 0, 1>, 0.5 } #declare bola = object { sphere{ < 0,0,0 >, 1 } texture{ tx_verde }} #declare cilindro = cylinder{ < 0, 0, 0 >, < 0, 0, 1 >, 1 } #declare toco = object { cilindro scale < 0.3, 0.3, 2 > texture{ tx_cinza } } #declare tanque1 = union { union { object { cilindro scale <1, 1, 3> } object { bola translate <0, 0, 3> } texture{ tx_branco } } object { toco translate < 0, 0, 3 > } object { toco rotate < 90, 0, 0 > translate < 0, 0, 2 > } } #declare tanque2 = union { object { caixa scale <1, 1, 3> texture{ tx_branco } } object { toco translate < 0, 0, 3 > } object { toco rotate < 90, 0, 0 > translate < 0, 0, 2 > } object { toco rotate <0, 90, 0 > translate < 0, 0, 1 > } object { toco rotate <-90, 0, 0 > translate < 0, 0, 1 > } } #declare tanque3 = union { object { object { conSection } scale <1, 1, 3> texture{ tx_branco } } object { toco translate < 0, 0, 3 > } object { toco rotate < 90, 0, 0 > translate < 0, 0, 2 > } object { toco rotate <0, 90, 0 > translate < 0, 0, 1 > } } #declare scaleAxis = 5; #declare roleta = seed(7); #macro gera_tanques(m, n) #declare indexX = 0; #while (indexX < m) #declare indexY = 0; #while (indexY < n) #local random = rand(roleta); #if (random < 0.33) object { tanque1 translate < indexX * scaleAxis, indexY * scaleAxis, 0 >} #else #if (random < 0.66) object { tanque2 translate < (indexX * scaleAxis), indexY * scaleAxis, 0 >} #else object { tanque3 translate < indexX * scaleAxis, indexY * scaleAxis, 0 >} #end #end #declare indexY = indexY + 1; #end #declare indexX = indexX + 1; #end #end #macro interpola1(tx, to, vo, t1, v1) #local ss = (tx - to)/(t1 - to); #local vv = ((1 - ss) * vo) + (ss * v1); vv #end #macro testa_interporla_1(po, p1, n, raio) union { #declare indice = 0; #while (indice < n) #local centro = interpola1(indice, 0, po, n, p1); object { bola scale translate centro } #declare indice = indice + 1; #end } #end #macro interpola3(tx, ta, tb, v0, v1, v2, v3) #local v01 = interpola1(tx, ta, v0, tb, v1); #local v12 = interpola1(tx, ta, v1, tb, v2); #local v23 = interpola1(tx, ta, v2, tb, v3); #local v012 = interpola1(tx, ta, v01, tb, v12); #local v123 = interpola1(tx, ta, v12, tb, v23); #local v0123 = interpola1(tx, ta, v012, tb, v123); v0123 #end #macro testa_interporla_3(po, p1, p2, p3, n, raio) union { #declare indice = 0; #while (indice < n) #local centro = interpola3(indice, 0, n, po, p1, p2, p3); object { bola scale translate centro } #declare indice = indice + 1; #end } #end #macro conecta_tubo(v0, v3) object { tanque2 translate v0} object { tanque1 translate v3} #local toco1 = v0 + < 0, 0, 5>; #local toco2 = v3 + < 0, -2, 2>; testa_interporla_3(toco1, toco1 + <0, 0, 12>, toco2 + <0, -4, 0>, toco2, 400, raio) #end #declare v0 = < 0, 0, 0 >; #declare v1 = < 0, 3, 20 >; #declare v2 = < 6, 0, 0 >; #declare v3 = < 4, 10, 0 >; #declare raio = 0.25; union { object{ tanque3 translate v2 } conecta_tubo(v0, v3) } // object{ eixos(10) } #declare cmin = < -02,-02,-01 >; #declare cmax = < +08,+12,+11 >; box{ cmin-<2,2,0> +<2,2,0.01> texture{ pigment{ color rgb 0.9*<1,1,1> } finish {diffuse 0.7 ambient 0.3 } } } #include "camlight.inc" #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.55*vlength(cmin - cmax); #declare dir_camera = < 40, 20, 30 >; #declare dist_camera = 7*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)