Camera Class Reference

Abstract camera that all Milton cameras subclass, representing a mapping from film-space to world-space and vice-versa. Cameras may optionally also specify an OpenGL preview projection matrix that can be used by OpenGLRenderer. Film-space is represented by (slightly modified) Normalized Device Coordinates (NDC), which are unit film-plane coordinates, with (x,y) both ranging inbetween 0 and 1. NDC lie in the unit square [0,1]^2, where [0,0] gets mapped to the upper left corner of the corresponding Viewport/Image, and [1,1] is the lower right corner. NDC film-space allows for mapping rendering results onto an arbitrarily-sized Viewport/Image. More...

#include <Camera.h>

Inheritance diagram for Camera:

Shape PropertyMap Intersectable SSEAligned ThinLensCamera PinholeCamera

List of all members.

Public Member Functions

Constructors
 Camera ()
virtual ~Camera ()
Initialization
virtual void init (Scene *scene)=0
 Initializes camera state from its PropertyMap.
Main usage interface
virtual Ray getWorldRay (const Point2 &pt) const =0
virtual Point2 getProjection (const Point3 &p) const =0
virtual Point2 getProjection (const Point3 &p, const Viewport &v) const
virtual void fillGLMatrix (real_t *buffer)=0
 Fills the 16-element, column-major buffer with an OpenGL projection matrix to preview the transformation of points from world-space to NDC using this camera model.
Accessors / Mutators
virtual void setOrientation (const Point3 &eye, const Vector3 &look, const Vector3 &up)=0
Sampling functionality
virtual Point3 getPosition (const UV &uv)

Protected Member Functions

virtual void _getUV (SurfacePoint &pt) const
virtual void _getGeometricNormal (SurfacePoint &pt) const


Detailed Description

Abstract camera that all Milton cameras subclass, representing a mapping from film-space to world-space and vice-versa. Cameras may optionally also specify an OpenGL preview projection matrix that can be used by OpenGLRenderer. Film-space is represented by (slightly modified) Normalized Device Coordinates (NDC), which are unit film-plane coordinates, with (x,y) both ranging inbetween 0 and 1. NDC lie in the unit square [0,1]^2, where [0,0] gets mapped to the upper left corner of the corresponding Viewport/Image, and [1,1] is the lower right corner. NDC film-space allows for mapping rendering results onto an arbitrarily-sized Viewport/Image.

Author:
Matthew Jacobs (jacobs.mh@gmail.com)

Travis Fischer (fisch0920@gmail.com)

Date:
Fall 2008
See also:
ThinLensCamera

Definition at line 32 of file Camera.h.


Constructor & Destructor Documentation

Camera::Camera (  )  [inline]

Definition at line 37 of file Camera.h.

virtual Camera::~Camera (  )  [inline, virtual]

Definition at line 41 of file Camera.h.


Member Function Documentation

virtual void Camera::init ( Scene scene  )  [pure virtual]

Initializes camera state from its PropertyMap.

Implemented in PinholeCamera, and ThinLensCamera.

virtual Ray Camera::getWorldRay ( const Point2 pt  )  const [pure virtual]

Returns:
a world-space ray for the given point on image plane
Parameters:
pt is a point on the film plane expressed in NDC ([0,1]^2)

Implemented in ThinLensCamera.

virtual Point2 Camera::getProjection ( const Point3 p  )  const [pure virtual]

Returns:
the projection of the given world-space point onto the film- plane (result is expressed in NDC ([0,1]^2))

Implemented in ThinLensCamera.

Point2 Camera::getProjection ( const Point3 p,
const Viewport v 
) const [virtual]

Returns:
the projection of the given world-space point onto the film- plane (result is expressed in pixel coordinates on the specified Viewport v)

Definition at line 26 of file Camera.cpp.

virtual void Camera::fillGLMatrix ( real_t buffer  )  [pure virtual]

Fills the 16-element, column-major buffer with an OpenGL projection matrix to preview the transformation of points from world-space to NDC using this camera model.

Implemented in ThinLensCamera.

virtual void Camera::setOrientation ( const Point3 eye,
const Vector3 look,
const Vector3 up 
) [pure virtual]

Implemented in ThinLensCamera.

Point3 Camera::getPosition ( const UV uv  )  [virtual]

Returns:
the point on the surface of this Camera corresponding to the given UV coordinates

Reimplemented from Shape.

Definition at line 34 of file Camera.cpp.

void Camera::_getUV ( SurfacePoint pt  )  const [protected, virtual]

Implements Shape.

Definition at line 38 of file Camera.cpp.

void Camera::_getGeometricNormal ( SurfacePoint pt  )  const [protected, virtual]

Implements Shape.

Definition at line 42 of file Camera.cpp.


The documentation for this class was generated from the following files:

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6