#include "colors.inc" #include "textures.inc" background { color rgb <1.0, 1.0, 1.0> } light_source { < 150, 1000, 1000 > color rgb < 1.0, 1.0, 1.0 > } camera { location < 80, 300, 380 >+< 125, 125, 0.0> sky <0,0,1> look_at < 125, 125, 0.0> } plane{ z, 0 texture{ pigment{ Yellow } } } #declare p = seed(pi) #declare cidade = union{ #declare norte_sul = 0; #while(norte_sul<5) #declare leste_oeste = 0; #while(leste_oeste<5) #declare num_janelas_fachada = int(8*rand(p)); #declare x_predio = int(50*rand(p)); #declare y_predio = int(20*rand(p)); #declare z_predio = int(120*rand(p)); #declare num_andares = z_predio/10; #declare tamanhox_janelas_fachada = x_predio/num_janelas_fachada; #declare tamanhoz_janelas_fachada = z_predio/(num_andares+1); #declare predio = difference{ box{ <0,0,0> texture{pigment{ VLightGray }} } #declare janelas_fachada = 1; #while ( janelas_fachada < (num_janelas_fachada+1) ) #declare andares = 1; #while ( andares < (num_andares+2) ) #if ( andares = 1 ) box{ <5,(y_predio-1),0> <(x_predio-5),(y_predio+1),8> pigment{CornflowerBlue} } box{ <(x_predio-1),2,2> <(x_predio+1),(y_predio-2),(z_predio-3)> pigment{CornflowerBlue} } box{ <-1,2,2> <1,(y_predio-2),(z_predio-3)> pigment{CornflowerBlue} } #else box{ pigment{CornflowerBlue} } box{ pigment{CornflowerBlue} } box{ <(x_predio-1),2,tamanhoz_janelas_fachada*(andares-1)> <(x_predio+1),(y_predio-2),tamanhoz_janelas_fachada*(andares-1)+7> pigment{CornflowerBlue} } box{ <-1,2,10*(andares-1)> <1,(y_predio-2),10*(andares-1)+7> pigment{CornflowerBlue} } #end #declare andares = andares + 1; #end #declare janelas_fachada = janelas_fachada + 1; #end translate<50*norte_sul,20*leste_oeste,0> } object{predio} #declare leste_oeste = leste_oeste + 1; #end #declare norte_sul = norte_sul + 1; #end } object {cidade}