When Cardinal Ludovisi wanted to cap his church, Rome's Sant'Ignazio di Loyola a Campo Marzio, with a towering dome, the story goes, neighbors objected to its blocking their enjoyment of light and air. So he commissioned Andrea Pozzo to paint a fresco that included the illusion of a dome for those standing inside the church's entrance. It is perhaps the most famous use of trompe-l'œil to suit practical necessity.
http://www.flickr.com/photos/wrldvoyagr/346097510/