ThinLensCamera Class Reference

Thin lens camera approximation supporting common camera inputs and allowing for depth of field. More...

#include <ThinLensCamera.h>

Inheritance diagram for ThinLensCamera:

Camera Shape PropertyMap Intersectable SSEAligned PinholeCamera

List of all members.

Public Member Functions

Constructors
 ThinLensCamera ()
virtual ~ThinLensCamera ()
Initialization
virtual void init (Scene *scene)
 Initializes camera state from its PropertyMap.
Main usage interface
virtual Ray getWorldRay (const Point2 &pt) const
virtual Point2 getProjection (const Point3 &p) const
virtual real_t getIntersection (const Ray &ray, SurfacePoint &pt)
 Tests the given ray with this object for intersection. If a valid intersection exists, its "t" value will be returned and the given SurfacePoint will be initialized with enough data for this object to later fill in all relevant information lazily (world space normal at intersection point, uv coordinates, etc.).
virtual void fillGLMatrix (real_t *buffer)
 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)
Point3 getEye () const
Vector3 getUp () const
Vector3 getLook () const
Vector3 getU () const
Vector3 getV () const
Vector3 getN () const

Protected Member Functions

void _computeMatrix ()

Protected Attributes

Matrix4x4 m_filmToWorld
Matrix4x4 m_worldToFilm
Point3 m_eye
 Position.
Vector3 m_u
 Camera's internal right-handed coordinate system.
Vector3 m_v
Vector3 m_n
real_t m_near
 Clipping planes.
real_t m_far
real_t m_aspect
 View volume parameters.
real_t m_hAngle
real_t m_aperture
 Aperture diameter (input in mm; stored internally in meters).
real_t m_fstop
 F-stop or F-number; unitless.
real_t m_focalLength
 Focal length in meters.
real_t m_focalDistance
 Focal distance in meters.


Detailed Description

Thin lens camera approximation supporting common camera inputs and allowing for depth of field.

Author:
Travis Fischer (fisch0920@gmail.com)
Date:
January 2008
Parameters:
aperture - diameter of the aperature of the lens in mm (eg. 35mm, 50mm)
fstop - (aka F number), is defined as the unitless ratio of the focal length to the diameter of the aperture of the lens
focalDistance - the distance in meters between the lens and the focal plane (objects lying on the focal plane will be in perfect focus)
focalPoint - (optional) user may specify a focalPoint in NDC on the film-plane instead of specifying a focalDistance to "auto-focus" the object intersected by a ray traced through the corresponding pixel, whose distance away from the lens will be used as the focalDistance.
Note:
focalPoint is expressed as a vector2 in the unit square [0,1]^2, where [0,0] is the upper left corner of the image, and [1,1] is the lower right corner
(focal length is derived from fstop and aperture)

See also:
http://www.eecs.berkeley.edu/~barsky/VisRendPapers/survey1.pdf

Definition at line 39 of file ThinLensCamera.h.


Constructor & Destructor Documentation

ThinLensCamera::ThinLensCamera (  ) 

Definition at line 42 of file ThinLensCamera.cpp.

ThinLensCamera::~ThinLensCamera (  )  [virtual]

Definition at line 57 of file ThinLensCamera.cpp.


Member Function Documentation

void ThinLensCamera::init ( Scene scene  )  [virtual]

Initializes camera state from its PropertyMap.

Implements Camera.

Reimplemented in PinholeCamera.

Definition at line 60 of file ThinLensCamera.cpp.

Ray ThinLensCamera::getWorldRay ( const Point2 pt  )  const [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)

Implements Camera.

Definition at line 129 of file ThinLensCamera.cpp.

Point2 ThinLensCamera::getProjection ( const Point3 p  )  const [virtual]

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

Implements Camera.

Definition at line 263 of file ThinLensCamera.cpp.

real_t ThinLensCamera::getIntersection ( const Ray ray,
SurfacePoint pt 
) [virtual]

Tests the given ray with this object for intersection. If a valid intersection exists, its "t" value will be returned and the given SurfacePoint will be initialized with enough data for this object to later fill in all relevant information lazily (world space normal at intersection point, uv coordinates, etc.).

Note:
if you only care about whether or not an intersection exists and don't actually need to know the exact intersection point, see the intersects method instead.
Returns:
the smallest positive "t" value of any intersections found, or INFINITY if no valid intersection exists

Implements Intersectable.

Definition at line 259 of file ThinLensCamera.cpp.

void ThinLensCamera::fillGLMatrix ( real_t buffer  )  [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.

Implements Camera.

Definition at line 175 of file ThinLensCamera.cpp.

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

Implements Camera.

Definition at line 239 of file ThinLensCamera.cpp.

Point3 ThinLensCamera::getEye (  )  const [inline]

Definition at line 76 of file ThinLensCamera.h.

Vector3 ThinLensCamera::getUp (  )  const [inline]

Definition at line 80 of file ThinLensCamera.h.

Vector3 ThinLensCamera::getLook (  )  const [inline]

Definition at line 84 of file ThinLensCamera.h.

Vector3 ThinLensCamera::getU (  )  const [inline]

Definition at line 88 of file ThinLensCamera.h.

Vector3 ThinLensCamera::getV (  )  const [inline]

Definition at line 92 of file ThinLensCamera.h.

Vector3 ThinLensCamera::getN (  )  const [inline]

Definition at line 96 of file ThinLensCamera.h.

void ThinLensCamera::_computeMatrix (  )  [protected]

Definition at line 179 of file ThinLensCamera.cpp.


Member Data Documentation

Definition at line 107 of file ThinLensCamera.h.

Definition at line 108 of file ThinLensCamera.h.

Position.

Definition at line 111 of file ThinLensCamera.h.

Camera's internal right-handed coordinate system.

Definition at line 114 of file ThinLensCamera.h.

Definition at line 114 of file ThinLensCamera.h.

Definition at line 114 of file ThinLensCamera.h.

Clipping planes.

Definition at line 117 of file ThinLensCamera.h.

Definition at line 117 of file ThinLensCamera.h.

View volume parameters.

Definition at line 120 of file ThinLensCamera.h.

Definition at line 121 of file ThinLensCamera.h.

Aperture diameter (input in mm; stored internally in meters).

Definition at line 124 of file ThinLensCamera.h.

F-stop or F-number; unitless.

Definition at line 127 of file ThinLensCamera.h.

Focal length in meters.

Definition at line 130 of file ThinLensCamera.h.

Focal distance in meters.

Definition at line 133 of file ThinLensCamera.h.


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

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6