// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2000-09-21 20:06:05 by stolfi background{ color rgb < 0.00, 0.75, 1 > } light_source { < 10.00, 48.00, 300.00 > color rgb < 4.00, 4.00, 4.00 > } camera { location < 80.00, 60.00, 30.00 > //right < 1.00, 0.00, 0.00 > //up < 0.00, 1.00, 0.00 > sky < 0.00, 0.00, 1.00 > look_at < 100.00, 200.00, 1.00 > } #declare quarteirao = union { box { <0,2,0>, <100,98,.2> } box { <2,0,0>, <98,100,.2> } cylinder { <2,2,0>, <2,2,0.2>, 2 } cylinder { <2,98,0>, <2,98,0.2>, 2 } cylinder { <98,2,0>, <98,2,0.2>, 2 } cylinder { <98,98,0>, <98,98,0.2>, 2 } texture { pigment {color rgb <.5,.5,.5>} } } #declare r = 2; #declare s = 3; #declare n = 5; #declare corpredio = union { difference { box { <0,0,0>, <2*r+6,2*s+6,8> } box { <0.3,0.3,0>, <2*r+6-.3,2*s+6-.3,7.7> } } #declare i = 0; #while (i < n) difference { box { <2,2,0>, <2*r+4,2*s+4,3> translate <0,0,8+3*i> } box { <2.3,2.3,0>, <2*r+4-.3,2*s+4-.3,2.7> translate <0,0,8+3*i> } } #declare i = i+1; #end difference { box { <4,4,0>, <2*r+2,2*s+2,3> translate <0,0,8+3*n> } box { <4.3,4.3,0>, <2*r+2-.3,2*s+2-.3,2.7> translate <0,0,8+3*n> } } } #declare furajan = union { #declare i = 0; #while (i < r) box { <3.5+i*2,-.4,5>, <4.5+i*2,2*s+6.4,6> } #declare j = 0; #while (j < n) box { <3.5+i*2,-.4,9+3*j>, <4.5+i*2,2*s+6.4,10+3*j> } #declare j = j+1; #end #declare i = i+1; #end box { , } #declare i = 0; #while (i < s) box { <-.4,3.5+i*2,5>, <2*r+6.4,4.5+i*2,6> } #declare j = 0; #while (j < n) box { <-.4,3.5+i*2,9+3*j>, <2*r+6.4,4.5+i*2,10+3*j> } #declare j = j+1; #end #declare i = i+1; #end box { <-.4,s+2.5,9+3*n>, <2*r+6.4,s+3.5,10+3*n> } } #declare janela = intersection { object {corpredio} object {furajan} } #declare furaporta = box { , } #declare porta = intersection { object {corpredio} object {furaporta} } #declare predio = union { difference { difference { object {corpredio} object {furajan} } object {furaporta} texture {pigment {color rgb <.8,.8,.8> } } } object { janela texture {pigment {color rgb <0,0,1> transmit .7 }} } object { porta texture {pigment {color rgb <.5,.4,0> }} } } // Aqui está a cena, finalmente: #declare p = 4; #declare q = 3; #declare i = 0; union { #while (i < p) #declare j = 0; #while (j < p) object { quarteirao translate <106*j,106*i,0> } object {predio //rotate <0,0,180> translate <106*i+2,106*j+2,.2> } #declare j = j+1; #end #declare i = i+1; #end } plane { <0,0,1>, 0 texture { pigment {color rgb <0,0,.04>} } }