#include <camera.h>
Inheritance diagram for toxic::Camera:

Public Member Functions | |
| Camera (const sheep::Matrix4 &m, sheep::Real hfov=DEFAULT_CAMERA_HFOV, sheep::Real aspect_ratio=DEFAULT_CAMERA_ASPECT_RATIO) | |
| m is the object space to world space transformation matrix. | |
| void | Finalize (const Context &context, const Scene *scene) |
| void | EnableDepthOfField (sheep::Real fstop, sheep::Real focal_length, sheep::Real focal_distance) |
| void | EnableAutoFocus (const sheep::Point2 &p) |
| Ray | ComputeRay (const Context &context, const sheep::Point2 &p) const |
| sheep::Point2 | Project (const sheep::Point3 &p) const |
Private Attributes | |
| sheep::Point3 | m_location |
| Location of the camera, expressed in world space. | |
| sheep::Vector3 | m_ex |
| sheep::Vector3 | m_ey |
| sheep::Vector3 | m_ez |
| Basis vectors, expressed in world space. m_ex is scaled by the aspect ratio. | |
| sheep::Vector3 | m_u |
| sheep::Vector3 | m_w |
| m_u = m_ex * m_aspect_ratio, m_w = m_ez * (-m_focal_length). | |
| sheep::Real | m_hfov |
| User defined horizontal field of view, expressed in radians. | |
| sheep::Real | m_aspect_ratio |
| User defined aspect ratio. | |
| sheep::Real | m_focal_length |
| Lens focal length (computed from horizontal field of view and aspect ratio values). | |
| bool | m_is_dof_enabled |
| True if depth of field is enabled, false otherwise. | |
| sheep::Real | m_dof_fstop |
| User defined f-stop number. | |
| sheep::Real | m_dof_focal_length |
| User defined focal length (distinct from m_focal_length). | |
| sheep::Real | m_dof_focal_distance |
| User defined distance of the focus plane from the lens center. | |
| sheep::Real | m_dof_lens_radius |
| Lens radius (computed from DOF focal length value and f-stop number). | |
| bool | m_is_autofocus_enabled |
| True if autofocus is enabled, false otherwise. | |
| sheep::Point2 | m_autofocus_target |
| Focus point, expressed in NDC. Used only by the autofocus mechanism. | |
Normalized Device Coordinates (NDC) are normalized pixel coordinates so that x and y both run from -0.5 to +0.5 across the entire (uncropped) image, with (-0.5, -0.5) being at the lower left of the image, and (0.5, 0.5) being at the upper right of the image (regardless of the aspect ratio).
Definition at line 50 of file camera.h.
|
||||||||||||||||
|
m is the object space to world space transformation matrix.
Definition at line 35 of file camera.cpp. References m_aspect_ratio, m_ex, m_ez, m_focal_length, m_hfov, m_u, m_w, and sheep::PI. |
|
||||||||||||
|
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. Definition at line 103 of file camera.cpp. References m_dof_focal_distance, m_dof_lens_radius, m_ex, m_ey, m_ez, m_is_dof_enabled, m_location, m_u, m_w, sheep::Point2::m_x, sheep::Vector3::m_y, sheep::Point2::m_y, sheep::Vector3::Normalize(), sheep::Vector3::Normalized(), and UniformDiskSampling(). |
|
|
Enables autofocus. Autofocus computes the right focal distance so that point of the scene visible through point 'p' is in focus plane. 'p' is a point on the film plane, expressed in NDC.
Definition at line 95 of file camera.cpp. References m_autofocus_target, m_is_autofocus_enabled, sheep::Point2::m_x, and sheep::Point2::m_y. |
|
||||||||||||||||
|
Enables depth of field. From "The RenderMan Interface Version 3.2": 'focal_distance' sets the distance along the direction of view at which objects will be in focus. 'focal_length' sets the focal length of the camera. These two parameters should have the units of distance along the view direction in camera coordinates. 'fstop', or aperture number, determines the lens diameter: lens_diameter = focal_length / fstop.
Definition at line 81 of file camera.cpp. References m_dof_focal_distance, m_dof_focal_length, m_dof_fstop, m_dof_lens_radius, and m_is_dof_enabled. |
|
||||||||||||
|
This method must be called only once, after the camera is completely configured, and before it is used for the first time. Definition at line 61 of file camera.cpp. References toxic::Hit::m_abscissa, m_autofocus_target, toxic::Ray::m_direction, m_dof_focal_distance, m_ey, m_is_autofocus_enabled, m_location, toxic::Ray::m_origin, m_u, m_w, sheep::Point2::m_x, sheep::Point2::m_y, sheep::Vector3::Normalize(), and toxic::Scene::Trace(). |
|
|
Definition at line 142 of file camera.cpp. References m_aspect_ratio, m_ex, m_ey, m_ez, m_focal_length, and m_location. |
|
|
User defined aspect ratio.
|
|
|
Focus point, expressed in NDC. Used only by the autofocus mechanism.
Definition at line 107 of file camera.h. Referenced by EnableAutoFocus(), and Finalize(). |
|
|
User defined distance of the focus plane from the lens center.
Definition at line 104 of file camera.h. Referenced by ComputeRay(), EnableDepthOfField(), and Finalize(). |
|
|
User defined focal length (distinct from m_focal_length).
Definition at line 103 of file camera.h. Referenced by EnableDepthOfField(). |
|
|
User defined f-stop number.
Definition at line 102 of file camera.h. Referenced by EnableDepthOfField(). |
|
|
Lens radius (computed from DOF focal length value and f-stop number).
Definition at line 105 of file camera.h. Referenced by ComputeRay(), and EnableDepthOfField(). |
|
|
Definition at line 92 of file camera.h. Referenced by Camera(), ComputeRay(), and Project(). |
|
|
Definition at line 92 of file camera.h. Referenced by ComputeRay(), Finalize(), and Project(). |
|
|
Basis vectors, expressed in world space. m_ex is scaled by the aspect ratio.
Definition at line 92 of file camera.h. Referenced by Camera(), ComputeRay(), and Project(). |
|
|
Lens focal length (computed from horizontal field of view and aspect ratio values).
|
|
|
User defined horizontal field of view, expressed in radians.
Definition at line 96 of file camera.h. Referenced by Camera(). |
|
|
True if autofocus is enabled, false otherwise.
Definition at line 106 of file camera.h. Referenced by EnableAutoFocus(), and Finalize(). |
|
|
True if depth of field is enabled, false otherwise.
Definition at line 101 of file camera.h. Referenced by ComputeRay(), and EnableDepthOfField(). |
|
|
Location of the camera, expressed in world space.
Definition at line 91 of file camera.h. Referenced by ComputeRay(), Finalize(), and Project(). |
|
|
Definition at line 93 of file camera.h. Referenced by Camera(), ComputeRay(), and Finalize(). |
|
|
m_u = m_ex * m_aspect_ratio, m_w = m_ez * (-m_focal_length).
Definition at line 93 of file camera.h. Referenced by Camera(), ComputeRay(), and Finalize(). |
1.3.6