Euclid
Geometry Processing and Shape Analysis in C++
Euclid::PerspRayCamera Class Reference

A RayCamera using perspective projection. More...

#include <RayTracer.h>

Inheritance diagram for Euclid::PerspRayCamera:
Euclid::RayCamera Euclid::Camera

Public Member Functions

 PerspRayCamera ()=default
 Create a PerspRayCamera using default parameters.
 
 PerspRayCamera (const Vec3 &position, const Vec3 &focus, const Vec3 &up, float vfov, float aspect, float tnear, float tfar)
 Create a PerspRayCamera. More...
 
 PerspRayCamera (const Vec3 &position, const Vec3 &focus, const Vec3 &up, float vfov, unsigned width, unsigned height, float tnear, float tfar)
 Create a PerspRayCamera. More...
 
void set_aspect (float aspect)
 Set aspect ratio.
 
void set_aspect (unsigned width, unsigned height)
 Set aspect ratio.
 
void set_fov (float vfov)
 Set vertical fov in degrees.
 
RTCRayHit gen_ray (float s, float t) const override
 Generate an embree rayhit structure. More...
 
- Public Member Functions inherited from Euclid::RayCamera
 RayCamera ()=default
 Create a RayCamera.
 
 RayCamera (const Vec3 &position, const Vec3 &focus, const Vec3 &up, float tnear, float tfar)
 Create a RayCamera. More...
 
- Public Member Functions inherited from Euclid::Camera
 Camera ()=default
 Create a Camera with default paramters.
 
 Camera (const Vec3 &position, const Vec3 &focus, const Vec3 &up, float tnear, float tfar)
 Create a Camera. More...
 
void lookat (const Vec3 &position, const Vec3 &focus, const Vec3 &up)
 Pose the camera according to the parameteres.
 
void set_range (float tnear, float tfar)
 Set the range of the ray. More...
 

Additional Inherited Members

- Public Types inherited from Euclid::Camera
using Vec3 = Eigen::Vector3f
 
- Public Attributes inherited from Euclid::RayCamera
Film film
 The film plane. More...
 
- Public Attributes inherited from Euclid::Camera
Eigen::Vector3f pos { 0.0f, 0.0f, 0.0f }
 Position.
 
Eigen::Vector3f u { 1.0f, 0.0f, 0.0f }
 Right vector.
 
Eigen::Vector3f v { 0.0f, 1.0f, 0.0f }
 Up vector.
 
Eigen::Vector3f dir { 0.0f, 0.0f, 1.0f }
 Negative view vector.
 
float tnear = 0.0f
 The near plane.
 
float tfar = std::numeric_limits<float>::max()
 The far plane.
 

Detailed Description

The range of visible frustum of a perspective camera is determined by the field of view and aspect ratio.

Constructor & Destructor Documentation

Euclid::PerspRayCamera::PerspRayCamera ( const Vec3 &  position,
const Vec3 &  focus,
const Vec3 &  up,
float  vfov,
float  aspect,
float  tnear,
float  tfar 
)
inline

In addition to camera position and orientation, a perspective camera uses field of view and apsect ratio to determine the extent of the film plane.

Parameters
positionPosition.
focusFocus.
upRough up direction.
vfovVertical field of view in degrees.
aspectAspect ratio.
tnearThe near clipping plane.
tfarThe far clipping plane.
Euclid::PerspRayCamera::PerspRayCamera ( const Vec3 &  position,
const Vec3 &  focus,
const Vec3 &  up,
float  vfov,
unsigned  width,
unsigned  height,
float  tnear,
float  tfar 
)
inline

In addition to camera position and orientation, a perspective camera uses field of view and apsect ratio to determine the extent of the film plane.

Parameters
positionPosition.
focusFocus.
upRough up direction.
vfovVertical field of view in degrees.
widthWidth of the image.
heightHeight of the image.
tnearThe near clipping plane.
tfarThe far clipping plane.

Member Function Documentation

RTCRayHit Euclid::PerspRayCamera::gen_ray ( float  s,
float  t 
) const
inlineoverridevirtual

The ray's origin be at the camera position and points to the pixel (s, t) on the film plane.

Implements Euclid::RayCamera.


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