// Setimo Exercicio de MC930 // Editado em 16/11 // Fabio Yuasa Niizu RA:962325 #include "textures.inc" #include "colors.inc" background{ color rgb < 1,1, 1 > } light_source { < -4.00, -30.00, 50.00 > color rgb < 1.00, 1.00, 1.00 > } camera { location < 50.00, -50.00, 20.0> right < -1.20, 0.00, 0.00 > up < 0.00, 0.00, 0.90 > sky < 0.00, 0.00, 1.00 > look_at < 0.00, 0.00, 20.00 > } #declare r=4; #declare s=2; #declare i=1; #declare j=0; #declare g=seed(pi); #if (rand(g)<0.8) #declare n=1; #end #if (rand(g)<0.6) #declare n=2; #end #if (rand(g)<0.4) #declare n=3; #end #if (rand(g)<0.2) #declare n=4; #end #declare terreo = box { < -(7*(r/2)+1), (5*(s/2)+1), 0.00>, // Near lower left corner < (7*(r/2)+1), -(5+(s/2)+1), 9.00> texture { pigment { color rgb < 1,1,1 > } } } #declare porta = box { < -2, (5*(s/2)+1), 0.00>, // Near lower left corner < 2, -(5+(s/2)+1.01), 5.00> texture { Gold_Nugget } } #declare andar = box { < -(7*(r/2)+1), (5*(s/2)+1), 0.00>, // Near lower left corner < (7*(r/2)+1), -(5+(s/2)+1), 5.00> texture { pigment { color rgb < 1,1,1 > } } } #declare janela_frontal = box { < -2.5, (5*(s/2)+1), 1.00>, // Near lower left corner < 2.5, -(5+(s/2)+1.01), 4.00> texture { Dark_Green_Glass } } #declare janela_lateral = box { < -(7*(r/2)+1.01), (1.5), 1.00>, // Near lower left corner < (7*(r/2)+1.01), -(1.5), 4.00> texture { Dark_Green_Glass } } #declare andar_inteiro = union { object { andar translate <0,0,9> } object { janela_frontal translate <3.5,0,9> } object { janela_frontal translate <-3.5,0,9> } object { janela_lateral translate <0,2.5,9> } object { janela_lateral translate <0,-2.5,9> } object { janela_frontal translate <10.5,0,9> } object { janela_frontal translate <-10.5,0,9> } } object { terreo } object { porta } object { andar_inteiro } #while (i < n) #declare j = j + 5; object { andar_inteiro translate <0,0,j> } #declare i = i + 1; #end