Controlling perspective has been a concern of architectural photographers for many years, but is not limited to photographing buildings.  Nature photographers experience the same distortion when photographing trees.  The distortion is caused when the camera's lens elements are not parallel to the structure being photographed.  However, if the camera is mounted on a tripod and level with the ground, you may not have the entire building in the field of view, and you will definitely get too much ground in front of the building (see figure to the left).  (The inset above the camera is a schematic of the recorded image on the film.)  On the other hand, if you tilt the camera up to encompass the entire building, you produce the distortion seen in the figure below left.  If you look at the building with the "naked eye", the lines appear to be parallel.  That is because the human brain compensates for this perspective distortion.  There are limits, however, to the brains ability to compensate, which is why if you look down railroad tracks, the tracks appear to come together in the distance (vanishing point), even though the brain knows the tracks are parallel as far as the eye can see. 

So how can a photographer correct for this problem?  One method would be to find a building in the neighborhood and climb to a level approximately opposite the center of the building you want to photograph.  Now you can align your camera so that you take the picture straight on (level with the ground).  Of course, you can stay on the ground and move farther away from the building, but this will cause the building to fill up only the top half of the frame (the bottom half being the foreground).  If, on the other hand, you move away from the building and use a telephoto lens, you can reduce the amount of distortion when you tilt the camera up (below left, third photo).  The smaller field of view and the smaller tilt angle account for the improved image. 

The last method requires a large cash outlay.   The lens is call a Tilt/Shift lens.  Large format, View cameras have the lens at the end of a bellows.  The bellows can be shifted or tilted relative to the film plane.  I will discuss tilting in another section.  Canon produces a 35mm Tilt/Shift lens for about $1,200.00 (street price, image below right).   If the lens is maintained perpendicular to the camera body, but shifted up, you will get more of the building at the top and less at the bottom even though the camera is held at a right angle to the ground and building.  The center of the lens is no longer at the center of the film plane.  The center is shifted up to the top of the film plane.  Remember that the image will be inverted. The top of the building is farther from the camera, and the top of the lens is farther from the film plane, and the distortion is eliminated.    

The final image at the bottom is a schematic of the arrangement.  The downside is that maximum shift produces dark corners at the top of the photo.  The dark corners will be accentuated if you use filters because the filter ring extends farther in front of the lens.  However, if you place a 2X teleconverter between the camera and lens, you can eliminate this artifact.  A teleconverter captures the image in the center of the lens and ignores the perimeter where the dark vignette occurs.