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

toxic::ICamera Class Reference

The camera is located at the origin and looks toward Z-. More...

#include <icamera.h>

Inheritance diagram for toxic::ICamera:

toxic::Basis toxic::PinholeCamera toxic::ThinLensCamera List of all members.

Public Member Functions

 ICamera (const sheep::Matrix4 &m, sheep::Real hfov, sheep::Real aspect_ratio)
virtual ~ICamera ()
virtual void Finalize (const Context &context, const Scene *scene)
virtual Ray ComputeRay (const Context &context, const sheep::Point2 &p) const=0
virtual sheep::Point2 Project (const sheep::Point3 &p) const=0
 Projects a point in the scene to the image plane.


Protected 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 m_hfov and m_aspect_ratio values).


Detailed Description

The camera is located at the origin and looks toward Z-.

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 corner of the image plane and (0.5, 0.5) being at the upper right corner, regardless of the image resolution.

Definition at line 47 of file icamera.h.


Constructor & Destructor Documentation

ICamera::ICamera const sheep::Matrix4 m,
sheep::Real  hfov,
sheep::Real  aspect_ratio
 

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

Definition at line 31 of file icamera.cpp.

References sheep::PI.

virtual toxic::ICamera::~ICamera  )  [inline, virtual]
 

Definition at line 57 of file icamera.h.


Member Function Documentation

virtual Ray toxic::ICamera::ComputeRay const Context context,
const sheep::Point2 p
const [pure 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.

Implemented in toxic::PinholeCamera, and toxic::ThinLensCamera.

Referenced by toxic::Renderer::render_pixel_supersampling(), toxic::Renderer::render_pixel_whitted(), and toxic::Renderer::whitted_recursive_sampling().

virtual void toxic::ICamera::Finalize const Context context,
const Scene scene
[inline, virtual]
 

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

Reimplemented in toxic::ThinLensCamera.

Definition at line 61 of file icamera.h.

virtual sheep::Point2 toxic::ICamera::Project const sheep::Point3 p  )  const [pure virtual]
 

Projects a point in the scene to the image plane.

Implemented in toxic::PinholeCamera, and toxic::ThinLensCamera.

Referenced by line().


Member Data Documentation

sheep::Real toxic::ICamera::m_aspect_ratio [protected]
 

User defined aspect ratio.

Definition at line 87 of file icamera.h.

sheep::Vector3 toxic::ICamera::m_ex [protected]
 

Definition at line 82 of file icamera.h.

sheep::Vector3 toxic::ICamera::m_ey [protected]
 

Definition at line 82 of file icamera.h.

sheep::Vector3 toxic::ICamera::m_ez [protected]
 

Basis vectors, expressed in world space. m_ex is scaled by the aspect ratio.

Definition at line 82 of file icamera.h.

sheep::Real toxic::ICamera::m_focal_length [protected]
 

Lens focal length (computed from m_hfov and m_aspect_ratio values).

Definition at line 88 of file icamera.h.

sheep::Real toxic::ICamera::m_hfov [protected]
 

User defined horizontal field of view, expressed in radians.

Definition at line 86 of file icamera.h.

sheep::Point3 toxic::ICamera::m_location [protected]
 

Location of the camera, expressed in world space.

Definition at line 81 of file icamera.h.

sheep::Vector3 toxic::ICamera::m_u [protected]
 

Definition at line 83 of file icamera.h.

sheep::Vector3 toxic::ICamera::m_w [protected]
 

m_u = m_ex * m_aspect_ratio, m_w = m_ez * (-m_focal_length).

Definition at line 83 of file icamera.h.


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