//Leandro Brioschi de Oliveira //MC 930 09-11-2000 Exercicio Pov_Ray - Professor Stolfi #include "colors.inc" background { SkyBlue } light_source { <-50, 25, -15> White } plane { y, -20 texture { pigment { checker color Green color White } } } camera { location < -50.00, 50.00, -50.00 > look_at < 0.00, 0.0 , 0.00 > } #declare RedX = texture { pigment { color Red } normal { bumps 0.6 scale 0.2 } finish { phong 1} } #declare YellowX = texture { pigment { color Yellow } normal { bumps 0.6 scale 0.2 } finish { phong 1} } #declare BlueX = texture { pigment { color Blue } normal { bumps 0.6 scale 0.2 } finish { phong 1} } #declare ligacao = cylinder { <4.50, 3.75, 3.50> <7.00, 3.75, 3.50> 1.00 pigment { color Black } } #declare ligacao2 = cylinder { <10.5, 6.55, 0.00> <10.5, 6.55, -3.50> 0.75 pigment { color Black } } #declare cilindro_corpo = cylinder { <4.00, 15.00, 0.00> <4.00, 15.00, 6.00> 4.00 pigment { Blue } } #declare cilindro_corpo_dentro = cylinder { <2.25, 0.50, 3.5> <2.25, 7.6, 3.5> 1.75 pigment { color Red } } #declare corpo_predio = box { < 0.00, 0.00, 0.00 >, < 8.0, 15.00, 6.00 > pigment { Blue } } #declare varanda = box { < 0.2, 2.3, 0.0 >, < 1.4, 2.5, -.5 > pigment { color Yellow } } #declare janela_lateral = box { < 0.00, 2.5, 0.30 >, < -0.1, 3.3, 1.00 > pigment { color Red } } #declare porta_varanda = box { < 0.4, 2.5, 0.0 >, < 1.2, 3.3, -0.10 > pigment { color Yellow } } #declare porta_solo = box { < 3, 0.0, 0.0 >, < 5, 2.0, -0.10 > pigment { color Gray } } #declare vermelhorugoso = texture { pigment { color Red } normal { bumps 0.6 scale 0.2 } finish { phong 1} } #declare esfera_corpo = sphere { < 10.50, 7.5, -4.50 >, 3.0 texture { YellowX } } #declare esfera_corpo_dentro = sphere { < 10.50, 7.5, -4.50 >, 2.50 pigment { color Yellow } } #declare corte_esfera = box { < 7.50, 7.5, -7.5 >, < 14.0, 11.50, 7.0 > pigment { color Yellow } } #declare j = 1; #declare k = 0; #declare i = 0; #declare cont = 0; #declare cont2 = 0; #declare c = seed (9.54521505515455225); #declare d = seed (11.21364578943646588796435151345679); #declare e = seed (253.16546544154654684231215487798798411); #declare f = seed (13.23165465411654165165484654165465); union { union { #while (cont<4) #declare aux =0; #while (aux<4) #if (rand(f) < .75) #declare predio = union { union { #if (rand (d) < .75) difference { object {cilindro_corpo } object {corpo_predio} } #end } object {corpo_predio} union{ #declare j =1; #while (j<5) #if (rand(d) > .75) object {janela_lateral translate <0,2.5*j, 0> } object {janela_lateral translate <0, 2.5*j ,2.3>} object {janela_lateral translate <0, 2.5*j,4.6>} #end #declare j = j + 1; #end } union { #declare k =1 ; #while (k<5) #if (rand(d) > .75) object {varanda translate <0,2.5*k,0> } object {varanda translate <1.6,2.5*k,0>} object {varanda translate <3.2,2.5*k,0>} object {varanda translate <4.8,2.5*k,0>} object {varanda translate <6.4,2.5*k,0>} #end #declare k = k + 1; #end } union { #declare i =1; #while (i<5) #if (rand(d) > .75) object {porta_varanda translate <0,2.5*i,0> } object {porta_varanda translate <1.6,2.5*i,0>} object {porta_varanda translate <3.2,2.5*i,0>} object {porta_varanda translate <4.8,2.5*i,0>} object {porta_varanda translate <6.4,2.5*i,0>} #end #declare i = i + 1; #end } union { #if (rand(c) < .75) object {porta_solo} #end } } object {predio translate <10*cont ,0, 8*aux >} #end #declare aux = aux + 1 ; #declare cont = cont + 1; #end #end } union { #while (cont2<4) #declare aux2 = 0; #while (aux2<4) #if (rand(e) < .75) #declare predio = union { union { #if (rand (d) < .75) difference { object {cilindro_corpo } object {corpo_predio} } #end } object {corpo_predio} union{ #declare j=1; #while (j<5) #if (rand(d) > .75) object {janela_lateral translate <0,2.5*j, 0> } object {janela_lateral translate <0, 2.5*j ,2.3>} object {janela_lateral translate <0, 2.5*j,4.6>} #end #declare j = j + 1; #end } union { #declare k=1; #while (k<5) #if (rand(d) > .75) object {varanda translate <0,2.5*k,0> } object {varanda translate <1.6,2.5*k,0>} object {varanda translate <3.2,2.5*k,0>} object {varanda translate <4.8,2.5*k,0>} object {varanda translate <6.4,2.5*k,0>} #end #declare k = k + 1; #end } union { #declare i=1; #while (i<5) #if (rand(d) > .75) object {porta_varanda translate <0,2.5*i,0> } object {porta_varanda translate <1.6,2.5*i,0>} object {porta_varanda translate <3.2,2.5*i,0>} object {porta_varanda translate <4.8,2.5*i,0>} object {porta_varanda translate <6.4,2.5*i,0>} #end #declare i = i + 1; #end } union { #if (rand(c) < .75) object {porta_solo} #end } } object {predio translate <-10*cont2 ,0, -8*aux2 >} #end #declare aux2 = aux2 + 1; #end #declare cont2 = cont2 + 1; #end } }