Base class for a camera used to render a scene.
The camera defines the mapping of the scene coordinate space onto the window.
Camera is an abstract class with two concrete subclasses:
The default camera is positioned in the scene such that its projection plane
in the scene coordinate space is at Z = 0, and it is looking into the screen in
the positive Z direction. The distance in Z from the camera to the projection
plane is determined by the
height of the Scene to
which it is attached and its
farClip of this camera are specified in the
eye coordinate space. This space is defined such that the eye is at its
origin and the projection plane is one unit in front of the eye in the
positive Z direction.
The following pseudo code is the math used to compute the near and far clip distances in the scene coordinate space:
final double tanOfHalfFOV = Math.tan(Math.toRadians(FOV) / 2.0); final double halfHeight = HEIGHT / 2; final double focalLenght = halfHeight / tanOfHalfFOV; final double eyePositionZ = -1.0 * focalLenght; final double nearClipDistance = focalLenght * NEAR + eyePositionZ; final double farClipDistance = focalLenght * FAR + eyePositionZ;
fieldOfView in degrees,
nearClip specified in eye space,
farClip specified in eye space.
Note: Since the ParallelCamera class has no
fieldOfView property, a
30 degrees vertical field of view is used.
Note: For the case of a PerspectiveCamera where the fixedEyeAtCameraZero
attribute is true, the scene coordinate space is normalized in order to fit
into the view frustum (see
PerspectiveCamera for more details). In
this mode, the eye coordinate space is the same as this Camera node's local
coordinate space. Hence the conversion formula mentioned above is not used.
An application should not extend the Camera class directly. Doing so may lead to an UnsupportedOperationException being thrown.