// MC930: Exercicio 7 - 16/11/2000 #include "textures.inc" #include "colors.inc" #include "finish.inc" background { color rgb < 1.00, 1.00, 0.80 > } light_source { < 20.00, 50.00, 20.00 > color rgb 3* < 1.00, 1.00, 1.00 > } camera { location < 20.00, 30.00, 30.00 > right < 2.40, 0.00, 0.00 > up < 0.00, 0.00, 1.80 > sky < 0.00, 1.00, 0.00 > look_at < 10.00, 25.00, 0.00 > } #declare tinta_AMAR = texture { pigment { color rgb < 1.00, 1.00, 0.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_AZUL = texture { pigment { color rgb < 0.00, 0.00, 1.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_VERD = texture { pigment { color rgb < 0.00, 0.50, 0.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_MARR = texture { pigment { color rgb < 0.20, 0.20, 0.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_BRAN = texture { pigment { color rgb < 1.00, 1.00, 1.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_PRET = texture { pigment { color rgb < 0.00, 0.00, 0.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_VIDR = texture { Glass } #declare chao = plane { y, 0 pigment {color rgb <0.90, 0.90, 0.90>} } #declare terreo = union { // terreno box { < -7.5, 0, -7.5>, < 7.5, 0.5, 7.5> texture { tinta_VERD } } // terreo box { < -5, 0.5, -5>, < 5, 5, 5> texture { tinta_BRAN } } // primeira laje box { < -5.2, 5, -5.2>, < 5.2, 6, 5.2> texture { tinta_PRET } } // porta box { < -1.5, 0.5, -2.5>, < 1.5, 3, 5.2> texture { tinta_MARR } } } #declare i = 1; #declare g = seed(pi); #declare andares = union { #declare n_and = rand(g) * 10; #while (i < n_and + 1) box { < -5, 1 + 5*i, -5>, < 5, 5 + 5*i, 5> texture { tinta_BRAN } } box { < -5.2, 5 + 5*i, -5.2>, < 5.2, 6 + 5*i, 5.2> texture { tinta_PRET } } // janelas de frente box { < -4.5, 1 + 5*i, 4.2>, < -2, 5 + 5*i, 5.1> texture { tinta_VIDR } } box { < -1.5, 1 + 5*i, 4.2>, < 1.5, 5 + 5*i, 5.1> texture { tinta_VIDR } } box { < 2, 1 + 5*i, 4.2>, < 4.5, 5 + 5*i, 5.1> texture { tinta_VIDR } } // janelas do fundo box { < -4.5, 1 + 5*i, -4.2>, < -2, 5 + 5*i, -5.1> texture { tinta_VIDR } } box { < -1.5, 1 + 5*i, -4.2>, < 1.5, 5 + 5*i, -5.1> texture { tinta_VIDR } } box { < 2, 1 + 5*i, -4.2>, < 4.5, 5 + 5*i, -5.1> texture { tinta_VIDR } } // janelas direitas box { < 4.2, 1 + 5*i, -4.5>, < 5.1, 5 + 5*i, -2> texture { tinta_VIDR } } box { < 4.2, 1 + 5*i, -1.5>, < 5.1, 5 + 5*i, 1.5> texture { tinta_VIDR } } box { < 4.2, 1 + 5*i, 2>, < 5.1, 5 + 5*i, 4.5> texture { tinta_VIDR } } // janelas esquerdas box { < -4.2, 1 + 5*i, -4.5>, < -5.1, 5 + 5*i, -2> texture { tinta_VIDR } } box { < -4.2, 1 + 5*i, -1.5>, < -5.1, 5 + 5*i, 1.5> texture { tinta_VIDR } } box { < -4.2, 1 + 5*i, 2>, < -5.1, 5 + 5*i, 4.5> texture { tinta_VIDR } } #declare i = i + 1; #end #declare i = 1; } #declare andares2 = union { #declare n_and = rand(g) * 11; #while (i < n_and + 1) box { < -5, 1 + 5*i, -5>, < 5, 5 + 5*i, 5> texture { tinta_BRAN } } box { < -5.2, 5 + 5*i, -5.2>, < 5.2, 6 + 5*i, 5.2> texture { tinta_PRET } } // janelas de frente box { < -4.5, 1 + 5*i, 4.2>, < -2, 5 + 5*i, 5.1> texture { tinta_VIDR } } box { < -1.5, 1 + 5*i, 4.2>, < 1.5, 5 + 5*i, 5.1> texture { tinta_VIDR } } box { < 2, 1 + 5*i, 4.2>, < 4.5, 5 + 5*i, 5.1> texture { tinta_VIDR } } // janelas do fundo box { < -4.5, 1 + 5*i, -4.2>, < -2, 5 + 5*i, -5.1> texture { tinta_VIDR } } box { < -1.5, 1 + 5*i, -4.2>, < 1.5, 5 + 5*i, -5.1> texture { tinta_VIDR } } box { < 2, 1 + 5*i, -4.2>, < 4.5, 5 + 5*i, -5.1> texture { tinta_VIDR } } // janelas direitas box { < 4.2, 1 + 5*i, -4.5>, < 5.1, 5 + 5*i, -2> texture { tinta_VIDR } } box { < 4.2, 1 + 5*i, -1.5>, < 5.1, 5 + 5*i, 1.5> texture { tinta_VIDR } } box { < 4.2, 1 + 5*i, 2>, < 5.1, 5 + 5*i, 4.5> texture { tinta_VIDR } } // janelas esquerdas box { < -4.2, 1 + 5*i, -4.5>, < -5.1, 5 + 5*i, -2> texture { tinta_VIDR } } box { < -4.2, 1 + 5*i, -1.5>, < -5.1, 5 + 5*i, 1.5> texture { tinta_VIDR } } box { < -4.2, 1 + 5*i, 2>, < -5.1, 5 + 5*i, 4.5> texture { tinta_VIDR } } #declare i = i + 1; #end #declare i = 1; } #declare andares3 = union { #declare n_and = rand(g) * 12; #while (i < n_and + 1) box { < -5, 1 + 5*i, -5>, < 5, 5 + 5*i, 5> texture { tinta_BRAN } } box { < -5.2, 5 + 5*i, -5.2>, < 5.2, 6 + 5*i, 5.2> texture { tinta_PRET } } // janelas de frente box { < -4.5, 1 + 5*i, 4.2>, < -2, 5 + 5*i, 5.1> texture { tinta_VIDR } } box { < -1.5, 1 + 5*i, 4.2>, < 1.5, 5 + 5*i, 5.1> texture { tinta_VIDR } } box { < 2, 1 + 5*i, 4.2>, < 4.5, 5 + 5*i, 5.1> texture { tinta_VIDR } } // janelas do fundo box { < -4.5, 1 + 5*i, -4.2>, < -2, 5 + 5*i, -5.1> texture { tinta_VIDR } } box { < -1.5, 1 + 5*i, -4.2>, < 1.5, 5 + 5*i, -5.1> texture { tinta_VIDR } } box { < 2, 1 + 5*i, -4.2>, < 4.5, 5 + 5*i, -5.1> texture { tinta_VIDR } } // janelas direitas box { < 4.2, 1 + 5*i, -4.5>, < 5.1, 5 + 5*i, -2> texture { tinta_VIDR } } box { < 4.2, 1 + 5*i, -1.5>, < 5.1, 5 + 5*i, 1.5> texture { tinta_VIDR } } box { < 4.2, 1 + 5*i, 2>, < 5.1, 5 + 5*i, 4.5> texture { tinta_VIDR } } // janelas esquerdas box { < -4.2, 1 + 5*i, -4.5>, < -5.1, 5 + 5*i, -2> texture { tinta_VIDR } } box { < -4.2, 1 + 5*i, -1.5>, < -5.1, 5 + 5*i, 1.5> texture { tinta_VIDR } } box { < -4.2, 1 + 5*i, 2>, < -5.1, 5 + 5*i, 4.5> texture { tinta_VIDR } } #declare i = i + 1; #end #declare i = 1; } #declare andares4 = union { #declare n_and = rand(g) * 12.5; #while (i < n_and + 1) box { < -5, 1 + 5*i, -5>, < 5, 5 + 5*i, 5> texture { tinta_BRAN } } box { < -5.2, 5 + 5*i, -5.2>, < 5.2, 6 + 5*i, 5.2> texture { tinta_PRET } } // janelas de frente box { < -4.5, 1 + 5*i, 4.2>, < -2, 5 + 5*i, 5.1> texture { tinta_VIDR } } box { < -1.5, 1 + 5*i, 4.2>, < 1.5, 5 + 5*i, 5.1> texture { tinta_VIDR } } box { < 2, 1 + 5*i, 4.2>, < 4.5, 5 + 5*i, 5.1> texture { tinta_VIDR } } // janelas do fundo box { < -4.5, 1 + 5*i, -4.2>, < -2, 5 + 5*i, -5.1> texture { tinta_VIDR } } box { < -1.5, 1 + 5*i, -4.2>, < 1.5, 5 + 5*i, -5.1> texture { tinta_VIDR } } box { < 2, 1 + 5*i, -4.2>, < 4.5, 5 + 5*i, -5.1> texture { tinta_VIDR } } // janelas direitas box { < 4.2, 1 + 5*i, -4.5>, < 5.1, 5 + 5*i, -2> texture { tinta_VIDR } } box { < 4.2, 1 + 5*i, -1.5>, < 5.1, 5 + 5*i, 1.5> texture { tinta_VIDR } } box { < 4.2, 1 + 5*i, 2>, < 5.1, 5 + 5*i, 4.5> texture { tinta_VIDR } } // janelas esquerdas box { < -4.2, 1 + 5*i, -4.5>, < -5.1, 5 + 5*i, -2> texture { tinta_VIDR } } box { < -4.2, 1 + 5*i, -1.5>, < -5.1, 5 + 5*i, 1.5> texture { tinta_VIDR } } box { < -4.2, 1 + 5*i, 2>, < -5.1, 5 + 5*i, 4.5> texture { tinta_VIDR } } #declare i = i + 1; #end #declare i = 1; } #declare andares5 = union { #declare n_and = rand(g) * 13; #while (i < n_and + 1) box { < -5, 1 + 5*i, -5>, < 5, 5 + 5*i, 5> texture { tinta_BRAN } } box { < -5.2, 5 + 5*i, -5.2>, < 5.2, 6 + 5*i, 5.2> texture { tinta_PRET } } // janelas de frente box { < -4.5, 1 + 5*i, 4.2>, < -2, 5 + 5*i, 5.1> texture { tinta_VIDR } } box { < -1.5, 1 + 5*i, 4.2>, < 1.5, 5 + 5*i, 5.1> texture { tinta_VIDR } } box { < 2, 1 + 5*i, 4.2>, < 4.5, 5 + 5*i, 5.1> texture { tinta_VIDR } } // janelas do fundo box { < -4.5, 1 + 5*i, -4.2>, < -2, 5 + 5*i, -5.1> texture { tinta_VIDR } } box { < -1.5, 1 + 5*i, -4.2>, < 1.5, 5 + 5*i, -5.1> texture { tinta_VIDR } } box { < 2, 1 + 5*i, -4.2>, < 4.5, 5 + 5*i, -5.1> texture { tinta_VIDR } } // janelas direitas box { < 4.2, 1 + 5*i, -4.5>, < 5.1, 5 + 5*i, -2> texture { tinta_VIDR } } box { < 4.2, 1 + 5*i, -1.5>, < 5.1, 5 + 5*i, 1.5> texture { tinta_VIDR } } box { < 4.2, 1 + 5*i, 2>, < 5.1, 5 + 5*i, 4.5> texture { tinta_VIDR } } // janelas esquerdas box { < -4.2, 1 + 5*i, -4.5>, < -5.1, 5 + 5*i, -2> texture { tinta_VIDR } } box { < -4.2, 1 + 5*i, -1.5>, < -5.1, 5 + 5*i, 1.5> texture { tinta_VIDR } } box { < -4.2, 1 + 5*i, 2>, < -5.1, 5 + 5*i, 4.5> texture { tinta_VIDR } } #declare i = i + 1; #end #declare i = 1; } #declare predio = union { object { terreo } object { andares } } #declare predio2 = union { object { terreo } object { andares2 } } #declare predio3 = union { object { terreo } object { andares3 } } #declare predio4 = union { object { terreo } object { andares4 } } #declare predio5 = union { object { terreo } object { andares5 } } #declare vazio = box { < -7.5, 0, -7.5>, < 7.5, 0.5, 7.5> texture { tinta_VERD } } // Cena Final object { chao } object { predio } object { predio2 translate < -25, 0, 0> } object { predio3 translate < 25, 0, 0> } object { vazio translate < 25, 0, 25> } object { vazio translate < 0, 0, 25> } object { predio4 translate < -25, 0, 25> } object { predio5 translate < 0, 0, -25> } object { predio3 translate < -25, 0, -25> } object { predio2 translate < -25, 0, -50> } object { predio translate < 0, 0, -50> } object { predio5 translate < -50, 0, -25> } object { predio4 translate < -50, 0, 0> }