HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::tools::PerspectiveCamera Class Reference

#include <RayTracer.h>

+ Inheritance diagram for openvdb::OPENVDB_VERSION_NAME::tools::PerspectiveCamera:

Public Member Functions

 PerspectiveCamera (Film &film, const Vec3R &rotation=Vec3R(0.0), const Vec3R &translation=Vec3R(0.0), double focalLength=50.0, double aperture=41.2136, double nearPlane=1e-3, double farPlane=std::numeric_limits< double >::max())
 Constructor. More...
 
 ~PerspectiveCamera () override=default
 
math::Ray< double > getRay (size_t i, size_t j, double iOffset=0.5, double jOffset=0.5) const override
 Return a Ray in world space given the pixel indices and optional offsets in the range [0,1]. An offset of 0.5 corresponds to the center of the pixel. More...
 
- Public Member Functions inherited from openvdb::OPENVDB_VERSION_NAME::tools::BaseCamera
 BaseCamera (Film &film, const Vec3R &rotation, const Vec3R &translation, double frameWidth, double nearPlane, double farPlane)
 
virtual ~BaseCamera ()
 
Film::RGBApixel (size_t i, size_t j)
 
size_t width () const
 
size_t height () const
 
void lookAt (const Vec3R &xyz, const Vec3R &up=Vec3R(0.0, 1.0, 0.0))
 
Vec3R rasterToScreen (double i, double j, double z) const
 

Static Public Member Functions

static double focalLengthToFieldOfView (double length, double aperture)
 Return the horizontal field of view in degrees given a focal lenth in mm and the specified aperture in mm. More...
 
static double fieldOfViewToFocalLength (double fov, double aperture)
 Return the focal length in mm given a horizontal field of view in degrees and the specified aperture in mm. More...
 

Additional Inherited Members

- Protected Member Functions inherited from openvdb::OPENVDB_VERSION_NAME::tools::BaseCamera
void initRay (double t0, double t1)
 
- Protected Attributes inherited from openvdb::OPENVDB_VERSION_NAME::tools::BaseCamera
FilmmFilm
 
double mScaleWidth
 
double mScaleHeight
 
math::Ray< double > mRay
 
math::AffineMap mScreenToWorld
 

Detailed Description

Definition at line 469 of file RayTracer.h.

Constructor & Destructor Documentation

openvdb::OPENVDB_VERSION_NAME::tools::PerspectiveCamera::PerspectiveCamera ( Film film,
const Vec3R rotation = Vec3R(0.0),
const Vec3R translation = Vec3R(0.0),
double  focalLength = 50.0,
double  aperture = 41.2136,
double  nearPlane = 1e-3,
double  farPlane = std::numeric_limits<double>::max() 
)
inline

Constructor.

Parameters
filmfilm (i.e. image) defining the pixel resolution
rotationrotation in degrees of the camera in world space (applied in x, y, z order)
translationtranslation of the camera in world-space units, applied after rotation
focalLengthfocal length of the camera in mm (the default of 50mm corresponds to Houdini's default camera)
aperturewidth in mm of the frame, i.e., the visible field (the default 41.2136 mm corresponds to Houdini's default camera)
nearPlanedepth of the near clipping plane in world-space units
farPlanedepth of the far clipping plane in world-space units

If no rotation or translation is provided, the camera is placed at (0,0,0) in world space and points in the direction of the negative z axis.

Definition at line 487 of file RayTracer.h.

openvdb::OPENVDB_VERSION_NAME::tools::PerspectiveCamera::~PerspectiveCamera ( )
overridedefault

Member Function Documentation

static double openvdb::OPENVDB_VERSION_NAME::tools::PerspectiveCamera::fieldOfViewToFocalLength ( double  fov,
double  aperture 
)
inlinestatic

Return the focal length in mm given a horizontal field of view in degrees and the specified aperture in mm.

Definition at line 523 of file RayTracer.h.

static double openvdb::OPENVDB_VERSION_NAME::tools::PerspectiveCamera::focalLengthToFieldOfView ( double  length,
double  aperture 
)
inlinestatic

Return the horizontal field of view in degrees given a focal lenth in mm and the specified aperture in mm.

Definition at line 517 of file RayTracer.h.

math::Ray<double> openvdb::OPENVDB_VERSION_NAME::tools::PerspectiveCamera::getRay ( size_t  i,
size_t  j,
double  iOffset = 0.5,
double  jOffset = 0.5 
) const
inlineoverridevirtual

Return a Ray in world space given the pixel indices and optional offsets in the range [0,1]. An offset of 0.5 corresponds to the center of the pixel.

Implements openvdb::OPENVDB_VERSION_NAME::tools::BaseCamera.

Definition at line 503 of file RayTracer.h.


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