Class View2Camera
- java.lang.Object
-
- renderer.pipeline.View2Camera
-
public final class View2Camera extends Object
Transform eachVertex
of aModel
from theCamera
's (shared) view coordinates to normalized camera coordinates.This stage transforms the
Camera
's view volume from a user defined shape (in the view coordinate system) into the standard normalized view volume (in the camera coordinate system) used by theClip
pipeline stage.There are two standard normalized view volumes, one for perspective projection and one for orthographic projection.
The standard normalized perspective view volume is the infinitely long pyramid with its apex at the origin and intersecting the image plane
z = -1
at the corners(-1, -1, -1)
and(+1, +1, -1)
.The standard normalized orthographic view volume is the infinitely long parallelepiped centered on the z-axis and intersecting the image plane
z = -1
at the corners(-1, -1, -1)
and(+1, +1, -1)
.The user defined view volume determined by the
Scene
'sCamera
object is either the infinitely long pyramid with its apex at the origin and intersecting the image planez = -1
at the corners(left, bottom, -1)
and(right, top, -1)
, or it is the infinitely long parallelepiped parallel to the z-axis and intersecting the image planez = -1
at the corners(left, bottom, -1)
and(right, top, -1)
.The view coordinate system is relative to the user defined view volume.
The normalized camera coordinate system is relative to the normalized view volume.
The matrix that transforms the user defined view volume into the normalized view volume also transform the view coordinate system into the normalized camera coordinate system.
The matrix that transforms view coordinates into normalized camera coordinates is derived in the comments of
PerspectiveNormalizeMatrix
andOrthographicNormalizeMatrix
.