It is possible for a camera to focus on more than one distance at a time by using movements that alter the plane of the lens and the plane of the film. Large format cameras mostly have that ability.
With smaller formats, just about all cameras are designed to only focus one distance at a time. This is done by keeping the film/sensor plane and the lens plane parallel to each other.
To change the focus distance, the distance between the lens and the film/sensor must change. As that distance increases, closer objects come into focus.
Latest Answers