Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

toxic::ThinLensCamera Class Reference

#include <thinlenscamera.h>

Inheritance diagram for toxic::ThinLensCamera:

toxic::ICamera toxic::Basis List of all members.

Public Member Functions

 ThinLensCamera (const sheep::Matrix4 &m, sheep::Real hfov, sheep::Real aspect_ratio, sheep::Real fstop, sheep::Real focal_length, sheep::Real focal_distance)
 ThinLensCamera (const sheep::Matrix4 &m, sheep::Real hfov, sheep::Real aspect_ratio, sheep::Real fstop, sheep::Real focal_length, const sheep::Point2 &af_target)
virtual void Finalize (const Context &context, const Scene *scene)
virtual Ray ComputeRay (const Context &context, const sheep::Point2 &p) const
virtual sheep::Point2 Project (const sheep::Point3 &p) const
 Projects a point in the scene to the image plane.


Private Attributes

sheep::Real m_lens_radius
 Lens radius (computed user defined f-stop number and DOF focal length).

sheep::Real m_focal_distance
 User defined distance of the focus plane from the lens center.

bool m_af_enabled
 True if autofocus is enabled, false otherwise.

sheep::Point2 m_af_target
 Focus point, expressed in NDC.


Constructor & Destructor Documentation

ThinLensCamera::ThinLensCamera const sheep::Matrix4 m,
sheep::Real  hfov,
sheep::Real  aspect_ratio,
sheep::Real  fstop,
sheep::Real  focal_length,
sheep::Real  focal_distance
 

'm' is the object space to world space transformation matrix. 'hfov' is the horizontal field of view, expressed in radians.

Definition at line 35 of file thinlenscamera.cpp.

References m_af_enabled, m_focal_distance, and m_lens_radius.

ThinLensCamera::ThinLensCamera const sheep::Matrix4 m,
sheep::Real  hfov,
sheep::Real  aspect_ratio,
sheep::Real  fstop,
sheep::Real  focal_length,
const sheep::Point2 af_target
 

This constructor intializes the focal distance with the autofocus mechanism. Autofocus computes the right focal distance so that the point of the scene visible through the point 'target' is in focus plane. 'target' is a point on the film plane, expressed in NDC. 'm' is the object space to world space transformation matrix. 'hfov' is the horizontal field of view, expressed in radians.

Definition at line 54 of file thinlenscamera.cpp.

References m_af_enabled, m_af_target, m_lens_radius, sheep::Point2::m_x, and sheep::Point2::m_y.


Member Function Documentation

Ray ThinLensCamera::ComputeRay const Context context,
const sheep::Point2 p
const [virtual]
 

Returns a ray whose origin is at camera location, and which is directed toward the point 'p'. 'p' is a point on the film plane. It is expressed in NDC. The returned ray is expressed in world space. The direction of the returned ray IS unit-length.

Implements toxic::ICamera.

Definition at line 101 of file thinlenscamera.cpp.

References m_focal_distance, m_lens_radius, toxic::Context::m_rng, sheep::Point2::m_x, sheep::Vector3::m_y, sheep::Point2::m_y, sheep::Vector3::Normalize(), sheep::Vector3::Normalized(), sheep::MT19937RNG::RandomReal1(), and UniformDiskSampling().

void ThinLensCamera::Finalize const Context context,
const Scene scene
[virtual]
 

This method must be called only once, after the camera is completely configured, and before it is used for the first time.

Reimplemented from toxic::ICamera.

Definition at line 75 of file thinlenscamera.cpp.

References toxic::Hit::m_abscissa, m_af_enabled, m_af_target, toxic::Ray::m_direction, m_focal_distance, toxic::Ray::m_origin, sheep::Point2::m_x, sheep::Point2::m_y, sheep::Vector3::Normalize(), and toxic::Scene::Trace().

Point2 ThinLensCamera::Project const sheep::Point3 p  )  const [virtual]
 

Projects a point in the scene to the image plane.

Implements toxic::ICamera.

Definition at line 139 of file thinlenscamera.cpp.


Member Data Documentation

bool toxic::ThinLensCamera::m_af_enabled [private]
 

True if autofocus is enabled, false otherwise.

Definition at line 92 of file thinlenscamera.h.

Referenced by Finalize(), and ThinLensCamera().

sheep::Point2 toxic::ThinLensCamera::m_af_target [private]
 

Focus point, expressed in NDC.

Definition at line 93 of file thinlenscamera.h.

Referenced by Finalize(), and ThinLensCamera().

sheep::Real toxic::ThinLensCamera::m_focal_distance [private]
 

User defined distance of the focus plane from the lens center.

Definition at line 91 of file thinlenscamera.h.

Referenced by ComputeRay(), Finalize(), and ThinLensCamera().

sheep::Real toxic::ThinLensCamera::m_lens_radius [private]
 

Lens radius (computed user defined f-stop number and DOF focal length).

Definition at line 90 of file thinlenscamera.h.

Referenced by ComputeRay(), and ThinLensCamera().


The documentation for this class was generated from the following files:
Generated on Tue May 11 01:31:59 2004 for toxic by doxygen 1.3.6