// Quinto exercicio de MP004 // Last edited on 2001-06-09 16:09:00 by Marcus Macedo background{ color rgb < 0.9, 0.9, 0.9 > } light_source { < 16.00, 15.00, 12.00 > color rgb < 1.00, 1.00, 1.00 > } camera { location < 15.00, 8.50, 6.00 > right < -1.20, 0.00, 0.00 > up < 0.00, 0.00, 0.90 > sky < 0.00, 0.00, 1.00 > look_at < 2.50, 4.50, 2.50 > } #declare amarelo_cinzento = texture { pigment { color rgb < 1.00, 1.00, 0.80 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare teto = box { < 0, 0, 4>, < 5, 9, 5> texture { amarelo_cinzento } } #declare templo = union { #declare g = seed(182736); #declare i = 1; #while (i < 7) #declare alt = 0.5 + 4.5*rand(g); #declare cx = 4*rand(g); #declare cy = 8*rand(g); #declare cor = #if (rand(g) < 0.5) texture { pigment { color rgb < 1.00, 0.00, 0.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #else texture { pigment { color rgb < 0.00, 1.00, 0.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #end #declare coluna = union { box { < 0, 0, 0>, < 1, 1, 0.5> } cylinder { < 0.5, 0.5, 0.5 >, < 0.5, 0.5, 0.5 + alt >, 0.25 } cone { < 0.5, 0.5, 0.5 + alt >, 0.25 < 0.5, 0.5, 1.0 + alt >, 0.0 } texture { cor } translate < cx, cy, 0> } object { coluna } #declare i = i + 1; #end object { teto } } #declare chao = plane { z, 0 pigment { color rgb < 0.00, 0.80, 0.90 > } } // Aqui está a cena, finalmente: object { chao } object { templo }