// Projeto final de MC930 #include "colors.inc" #include "stones.inc" #include "skies.inc" #include "metals.inc" #include "textures.inc" #include "finish.inc" background{ color rgb < 0.22, 0.00, 0.59 > } camera { location < -7.00, 15.00, 12.00 > right < 0.00, 1.20, 0.00 > up < 0.00, 0.00, 0.90 > sky < 0.00, 0.00, 1.00 > look_at < 0.00, -3.00, 5.00 > } light_source { <0.00, 15.00, 8.50> color rgb <1.00,1.00,1.00> } #declare torre = cylinder { <0.00,0.00,0.00>, <0.00,0.00,10.00>, 2 texture {T_Grnt2} } #declare circulo = torus { 2.0, 0.05 rotate -90*x texture {T_Copper_1A} } /*Grama*/ plane{ z, 0 texture{ pigment {image_map { gif "sprbk041a.gif"}}}} /*Nebulosidade*/ plane{ z, 5 texture{ P_Cloud1 }} /* Ceu */ plane { z, 150 texture { pigment { SkyBlue } finish { ambient 1 diffuse 0} } texture { pigment { bozo turbulence .5 color_map { [0 White] [1 White filter 1] } } finish { ambient 1 diffuse 0 } scale <1000, 250, 250> } } //#declare circulo = /*Desenha os objetos*/ object {torre} object {circulo translate <0.00,0.00,10.3> } object {circulo translate <0.00,0.00,10.6> } /* #declare preto = rgb < 0.00,0.00,0.00 >; #declare amarelo = rgb <1.00,1.00,0.00>; #declare cinza = rgb <0.50,0.50,0.50>; #declare verde = rgb <0.00,1.00,0.00>; #declare marrom = rgb <1.00,0.80,0.70>; #declare g = seed(2.52); #declare i = 1; #declare prob_terreno = 0.70; #declare qtd = 1; #declare loop = 1; #declare base = difference { box { <0.00,0.00,0.00>,<2.00,2.00,1.00> } box { <0.50,1.75,0.00>,<1.50,2.01,0.75> texture {pigment {color cinza}} } } #declare terreno = box { <0.00,0.00,0.00>,<2.00,2.00,0.10> texture {pigment {color marrom}} } #declare ruas = union { box { <-8.75,-2.75,0.00>,<8.75,-2.25,0.1> texture {pigment {color cinza}} } box { <-8.75,-2.75,0.00>,<-8.25,3.75,0.1> texture {pigment {color cinza}} } box { <8.75,-2.75,0.00>,<8.25,3.75,0.1> texture {pigment {color cinza}} } box { <0.25,-2.75,0.00>,<-0.25,3.75,0.1> texture {pigment {color cinza}} } box { <-8.75,-0.25,0.00>,<8.75,0.25,0.1> texture {pigment {color cinza}} } box { <-8.75, 0.25,0.00>,<8.75,1.25,0.05> texture {pigment {color verde}} } box { <-8.75, 1.25,0.00>,<8.75, 1.50,0.1> texture {pigment {color cinza}} } box { <-8.75, 3.50,0.00>,<8.75, 3.75,0.1> texture {pigment {color cinza}} } } object {ruas} #while (qtd <= 16) #declare andar = difference { difference { box { <0.00,0.00,0.00>,<2.00,2.00,1.00> } box { <0.20,1.90,0.20>,<0.80,2.01,0.80> #if (rand(g) < 0.50) texture {pigment {color amarelo}} #else texture {pigment {color preto}} #end } } box { <1.20,1.90,0.20>,<1.80,2.01,0.80> #if (rand(g) < 0.50) texture {pigment {color amarelo}} #else texture {pigment {color preto}} #end } } #declare predio = union { object {base} #declare i = 1; #while (i <= int((rand(g)*10)+1)) object {andar translate <0.00,0.00,i> } #declare i = i+1; #end } #if (loop = 4) #declare j = 1; #while (j < 5) #if (rand(g) < prob_terreno) object {predio texture {pigment {color rgb }} translate <6.25-(2*(j-1)), -2.25, 0.00> } #else object {terreno translate <6.25-(2*(j-1)), -2.25, 0.00> } #end #declare j = j+1; #end #end #if (loop = 3) #declare j = 1; #while (j < 5) #if (rand(g) < prob_terreno) object {predio texture {pigment {color rgb }} translate <-2.25-2*(j-1), -2.25, 0.00> } #else object {terreno translate <2.25-(2*(j-1)), -2.25, 0.00> } #end #declare j = j+1; #end #declare loop = 4; #end #if (loop = 2) #declare j=1; #while (j < 5) #if (rand(g) < prob_terreno) object {predio texture {pigment {color rgb }} translate <6.25-2*(j-1), 1.50, 0.00> } #else object {terreno translate <6.25-(2*(j-1)), 1.50, 0.00> } #end #declare j = j+1; #end #declare loop = 3; #end #if (loop = 1) #declare j=1; #while (j < 5) #if (rand(g) < prob_terreno) object {predio texture {pigment {color rgb }} translate <-2.25-2*(j-1), 1.50, 0.00> } #else object {terreno translate <-2.25-2*(j-1), 1.50, 0.00> } #end #declare j = j+1; #end #declare loop = 2; #end #declare qtd = qtd+1; #end */