#include <thinlenscamera.h>
Inheritance diagram for toxic::ThinLensCamera:

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. | |
|
||||||||||||||||||||||||||||
|
'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. |
|
||||||||||||||||||||||||||||
|
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. |
|
||||||||||||
|
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(). |
|
||||||||||||
|
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(). |
|
|
Projects a point in the scene to the image plane.
Implements toxic::ICamera. Definition at line 139 of file thinlenscamera.cpp. |
|
|
True if autofocus is enabled, false otherwise.
Definition at line 92 of file thinlenscamera.h. Referenced by Finalize(), and ThinLensCamera(). |
|
|
Focus point, expressed in NDC.
Definition at line 93 of file thinlenscamera.h. Referenced by Finalize(), and ThinLensCamera(). |
|
|
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(). |
|
|
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(). |
1.3.6