## Camera

key: cmr

type: s fff fff fff f ff ff f (C)*

1. s: name
2. fff: center of projection
3. fff: image plane normal
4. fff: up vector
5. f: ``focal length''
6. ff: image size (width, height)
7. ff: position of image center on image plane
8. f: time of exposure (not duration)
9. (C)*: optional chunks

## Description

This chunk defines a camera, which has to have a name and a basic geometry, and which may have other attributes for more realistic camera models that include focus effects, motion blur, etc.

The geometry parameters here specify just enough information to render images using a pinhole model. All distances are in meters; the time of exposure is in seconds. In concept, the image plane is always in front of the COP, at a distance of the focal length. I put focal length in quotes because for a pinhole model it is really just the image plane distance. The image size and position are measured in meters on the image plane, where the v axis is the normalized projection of the up vector onto the image plane, the u axis is such that (u, v, n) forms a left-handed orthonormal coordinate system, and the origin is the projection of the COP onto the image plane.

Here is a diagram to explain this:

If you are using a more advanced camera model, like a thin lens camera, then there are more parameters that affect the camera geometry, in particular the aperture size and focus distance. The respective chunk pages describe the parameters in more detail; in the diagram below, A is the aperture diameter, and the focus distance is p + q. This diagram shows the film plane, which is a reflection of the image plane through the origin. We need to have the film plane for the optics of image formation to make sense, so we flip it like this to make the image coordinates consistent with the image plane. With a thin lens, the focal length is really a focal length. When the focus distance is very large, the lens will be at the COP; as the focus distance gets closer, the lens moves away from the film plane. The formula that explains this needs another figure.

(Sorry about the camera battery on that one)

The mdl format does not specify how the image is sampled.

See the descriptions of the individual camera description chunks for more information.

## Example

Here is a camera that's a lot like a 35mm SLR with a 50mm lens, focus at 2 m, aperture f-5.6, and shutter speed 125 (1/125 s):
```  cmr
"Nikon"

% COP
3.0 5.0 2.0
% Image plane normal
0.0 0.0 1.0
% Up vector
0.0 1.0 0.0
% Image plane distance
0.050
% Image size
0.036 0.024
% Image center
0.0 0.0
% Time
0.0

fcsDstnc 2.0 end
aprtr 5.6 end
shtr 0.008 end
end
```