// MC930 - Exercicio 3 - Predio do IC // 05/10/2004 // Pablo Augusto Verissimo - RA 002266 #include "colors.inc" // ====================================================================== // CÂMERA camera { location < 20.0, 20.0, 20.0 > // Posição do observador. right -1.00*x // Largura RELATIVA da imagem. up 0.75*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 0.00, 0.00, 0.00 > // Para onde a câmera está apontando. } // Nota: os parâmetros "right" e "up" devem ter a mesma proporção // que os parâmetros ${WIDTH} e ${HEIGHT} no Makefile. // ====================================================================== // FONTES DE LUZ light_source { 10 * < +50.0, +30.0, +50.0 > // Posição da lâmpada. color rgb 1.2 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { 10 * < +50.0, -10.0, +10.0 > // Posição da lâmpada. color rgb 0.8 * < 0.90, 0.70, 0.80 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA background{ color rgb < 0.9, 0.9, 0.9 > } #declare raio = 2.000; //vermelho #declare tinta_A = texture { pigment { color rgb < 1, 0, 0 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } //meio amarelo #declare tinta_B = texture { pigment { color rgb < 1, 0.9, 0 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare cor_cristal = <0.1, 1, 0.1 >; #declare tx_cristal = texture { finish { ambient 0.1 diffuse 0.1 reflection 0.25 specular 1 roughness 0.001 } pigment { color cor_cristal filter 1 } } #declare cor_espelho = <1, 0, 0 >; #declare tx_espelho = texture { pigment { rgb cor_espelho } finish { ambient 0.05 diffuse 0.05 reflection cor_espelho specular 0.20 roughness 0.05 } } #declare cor_ouro = <1, 0.9, 0>; #declare tx_ouro = texture { pigment { rgb cor_ouro } finish { ambient 0.05 diffuse 0.05 reflection cor_ouro specular 0.20 roughness 0.05 } } #declare cor_ourot = < 1, 0.9, 0 >; #declare tx_ourot = texture { finish { ambient 0.1 diffuse 0.1 reflection 0.25 specular 1 roughness 0.001 } pigment { color cor_ourot filter 1 } } #declare topo = lathe { 4,<1.3,1.7>,<1.6,3>,<2.2,3>,<1.9,1.7> texture {tx_ourot} } //predio cilindrico #declare predio = union { //difference { #declare i2 = 0; #while (i2 < 4) cylinder { <0,0,3*i2>,<0,0,3*i2+3>,5 translate <0,0,-3> texture { tinta_A } } #declare i1 = 0; #declare i = 0; #declare j = seed(i1*12345); #declare r = 0.8; #while (i1 < 10) #declare janela = #if (rand(j) < 0.5) box { <-r,-r,-r>, } object { janela translate <0, 4.7, 2.5*i2> rotate i*36*z texture {tx_cristal} } #declare i = i+1; #else sphere { <0,0,0>,r } object { janela translate <0, 4.7, 2.5*i2> rotate i*36*z texture {tx_cristal} } #declare i = i+1; #end #declare i1 = i1+1; #end #declare i2 = i2+1; #end //} } #declare bolinha1 = sphere { <1.5,1.5,2.5>,0.2 texture {tx_espelho} } declare fileira = union { #declare i = 0; #while (i < 10) #declare r = 1 + 0.1*i; #declare treco = #if (i = 7) box { <-r,-r,-r>, } #else sphere { <0,0,0>,r } #end object { treco translate <3*i, i*i/5, 0> } #declare i = i +1; #end pigment { color rgb <1,0,0> } } //base hexagonal do predio #declare base = prism { linear_sweep linear_spline 0, // sweep the following shape from here ... 2, // ... up through here 7, // numero de pontos <6,8>, <-6,8>, <-8,3>, <-6,-8>, <6, -8>, <8,3>, <6,8> pigment { Gray } } //furo na base hexagonal #declare furonabase = prism { linear_sweep linear_spline -1, // sweep the following shape from here ... 3, // ... up through here 7, // numero de pontos <4.5,6.5>, <-4.5,6.5>, <-6.5,1.5>, <-4.5,-6.5>, <4.5, -6.5>, <6.5,1.5>, <4.5,6.5> pigment { Gray } } //plane { z,0 //texture { //pigment { checker <1,1,1>,<0,0,0> } //finish { ambient 0.1 diffuse 0.9 } //scale 0.5 //} //} #declare porta = box { <-3,-3,-3>,<3,3,3> } //**************************** //Aqui está a cena, finalmente: //**************************** //object { fileira translate <0,0,3> } //object { fileira translate <0,0,-3> } union { difference { object {base translate <0,-3,0> rotate 90*z rotate 90*y} object {furonabase translate <0,-3,0> rotate 90*z rotate 90*y} object {porta translate <0,-6,-1> rotate 90*z} } } object { predio }