Open3D (C++ API)  0.18.0+3975044
Data Structures | Public Types | Public Member Functions | Static Public Member Functions
open3d::visualization::rendering::Camera Class Referenceabstract

#include <Camera.h>

Inheritance diagram for open3d::visualization::rendering::Camera:
open3d::visualization::rendering::FilamentCamera

Data Structures

struct  ProjectionInfo
 

Public Types

enum class  FovType { Vertical , Horizontal }
 
enum class  Projection { Perspective , Ortho }
 
using Transform = Eigen::Transform< float, 3, Eigen::Affine >
 
using ProjectionMatrix = Eigen::Transform< float, 3, Eigen::Projective >
 

Public Member Functions

virtual ~Camera ()=default
 
virtual void SetProjection (double fov, double aspect, double near, double far, FovType fov_type)=0
 
virtual void SetProjection (Projection projection, double left, double right, double bottom, double top, double near, double far)=0
 
virtual void SetProjection (const Eigen::Matrix3d &intrinsics, double near, double far, double width, double height)=0
 
virtual void LookAt (const Eigen::Vector3f &center, const Eigen::Vector3f &eye, const Eigen::Vector3f &up)=0
 
virtual void FromExtrinsics (const Eigen::Matrix4d &extrinsics)
 
virtual void SetModelMatrix (const Transform &view)=0
 
virtual void SetModelMatrix (const Eigen::Vector3f &forward, const Eigen::Vector3f &left, const Eigen::Vector3f &up)=0
 
virtual double GetNear () const =0
 
virtual double GetFar () const =0
 
virtual double GetFieldOfView () const =0
 only valid if fov was passed to SetProjection() More...
 
virtual FovType GetFieldOfViewType () const =0
 only valid if fov was passed to SetProjection() More...
 
virtual Eigen::Vector3f GetPosition () const =0
 
virtual Eigen::Vector3f GetForwardVector () const =0
 
virtual Eigen::Vector3f GetLeftVector () const =0
 
virtual Eigen::Vector3f GetUpVector () const =0
 
virtual Transform GetModelMatrix () const =0
 
virtual Transform GetViewMatrix () const =0
 
virtual ProjectionMatrix GetProjectionMatrix () const =0
 
virtual Transform GetCullingProjectionMatrix () const =0
 
virtual Eigen::Vector3f Unproject (float x, float y, float z, float view_width, float view_height) const =0
 
virtual Eigen::Vector2f GetNDC (const Eigen::Vector3f &pt) const =0
 
virtual double GetViewZ (float z_buffer) const =0
 
virtual const ProjectionInfoGetProjection () const =0
 
virtual void CopyFrom (const Camera *camera)=0
 

Static Public Member Functions

static void SetupCameraAsPinholeCamera (rendering::Camera &camera, const Eigen::Matrix3d &intrinsic, const Eigen::Matrix4d &extrinsic, int intrinsic_width_px, int intrinsic_height_px, const geometry::AxisAlignedBoundingBox &scene_bounds)
 
static float CalcNearPlane ()
 Returns a good value for the near plane. More...
 
static float CalcFarPlane (const rendering::Camera &camera, const geometry::AxisAlignedBoundingBox &scene_bounds)
 

Member Typedef Documentation

◆ ProjectionMatrix

using open3d::visualization::rendering::Camera::ProjectionMatrix = Eigen::Transform<float, 3, Eigen::Projective>

◆ Transform

using open3d::visualization::rendering::Camera::Transform = Eigen::Transform<float, 3, Eigen::Affine>

Member Enumeration Documentation

◆ FovType

Enumerator
Vertical 
Horizontal 

◆ Projection

Enumerator
Perspective 
Ortho 

Constructor & Destructor Documentation

◆ ~Camera()

virtual open3d::visualization::rendering::Camera::~Camera ( )
virtualdefault

Member Function Documentation

◆ CalcFarPlane()

float open3d::visualization::rendering::Camera::CalcFarPlane ( const rendering::Camera camera,
const geometry::AxisAlignedBoundingBox scene_bounds 
)
static

Returns a value for the far plane that ensures that the entire bounds provided will not be clipped.

◆ CalcNearPlane()

float open3d::visualization::rendering::Camera::CalcNearPlane ( )
static

Returns a good value for the near plane.

◆ CopyFrom()

virtual void open3d::visualization::rendering::Camera::CopyFrom ( const Camera camera)
pure virtual

◆ FromExtrinsics()

void open3d::visualization::rendering::Camera::FromExtrinsics ( const Eigen::Matrix4d &  extrinsics)
virtual

◆ GetCullingProjectionMatrix()

virtual Transform open3d::visualization::rendering::Camera::GetCullingProjectionMatrix ( ) const
pure virtual

◆ GetFar()

virtual double open3d::visualization::rendering::Camera::GetFar ( ) const
pure virtual

◆ GetFieldOfView()

virtual double open3d::visualization::rendering::Camera::GetFieldOfView ( ) const
pure virtual

only valid if fov was passed to SetProjection()

Implemented in open3d::visualization::rendering::FilamentCamera.

◆ GetFieldOfViewType()

virtual FovType open3d::visualization::rendering::Camera::GetFieldOfViewType ( ) const
pure virtual

only valid if fov was passed to SetProjection()

Implemented in open3d::visualization::rendering::FilamentCamera.

◆ GetForwardVector()

virtual Eigen::Vector3f open3d::visualization::rendering::Camera::GetForwardVector ( ) const
pure virtual

◆ GetLeftVector()

virtual Eigen::Vector3f open3d::visualization::rendering::Camera::GetLeftVector ( ) const
pure virtual

◆ GetModelMatrix()

virtual Transform open3d::visualization::rendering::Camera::GetModelMatrix ( ) const
pure virtual

◆ GetNDC()

virtual Eigen::Vector2f open3d::visualization::rendering::Camera::GetNDC ( const Eigen::Vector3f &  pt) const
pure virtual

◆ GetNear()

virtual double open3d::visualization::rendering::Camera::GetNear ( ) const
pure virtual

◆ GetPosition()

virtual Eigen::Vector3f open3d::visualization::rendering::Camera::GetPosition ( ) const
pure virtual

◆ GetProjection()

virtual const ProjectionInfo& open3d::visualization::rendering::Camera::GetProjection ( ) const
pure virtual

◆ GetProjectionMatrix()

virtual ProjectionMatrix open3d::visualization::rendering::Camera::GetProjectionMatrix ( ) const
pure virtual

◆ GetUpVector()

virtual Eigen::Vector3f open3d::visualization::rendering::Camera::GetUpVector ( ) const
pure virtual

◆ GetViewMatrix()

virtual Transform open3d::visualization::rendering::Camera::GetViewMatrix ( ) const
pure virtual

◆ GetViewZ()

virtual double open3d::visualization::rendering::Camera::GetViewZ ( float  z_buffer) const
pure virtual

Returns the view space depth (i.e., distance from camera) for the given Z-buffer value

Implemented in open3d::visualization::rendering::FilamentCamera.

◆ LookAt()

virtual void open3d::visualization::rendering::Camera::LookAt ( const Eigen::Vector3f &  center,
const Eigen::Vector3f &  eye,
const Eigen::Vector3f &  up 
)
pure virtual

◆ SetModelMatrix() [1/2]

virtual void open3d::visualization::rendering::Camera::SetModelMatrix ( const Eigen::Vector3f &  forward,
const Eigen::Vector3f &  left,
const Eigen::Vector3f &  up 
)
pure virtual

◆ SetModelMatrix() [2/2]

virtual void open3d::visualization::rendering::Camera::SetModelMatrix ( const Transform view)
pure virtual

◆ SetProjection() [1/3]

virtual void open3d::visualization::rendering::Camera::SetProjection ( const Eigen::Matrix3d &  intrinsics,
double  near,
double  far,
double  width,
double  height 
)
pure virtual

◆ SetProjection() [2/3]

virtual void open3d::visualization::rendering::Camera::SetProjection ( double  fov,
double  aspect,
double  near,
double  far,
FovType  fov_type 
)
pure virtual

◆ SetProjection() [3/3]

virtual void open3d::visualization::rendering::Camera::SetProjection ( Projection  projection,
double  left,
double  right,
double  bottom,
double  top,
double  near,
double  far 
)
pure virtual

Sets the projection matrix from a frustum defined by six planes.

Parameters
projectiontype of Projection to use.
leftdistance in world units from the camera to the left plane, at the near plane.
rightdistance in world units from the camera to the right plane, at the near plane.
bottomdistance in world units from the camera to the bottom plane, at the near plane.
topdistance in world units from the camera to the top plane, at the near plane.
neardistance in world units from the camera to the near plane. The near plane's
fardistance in world units from the camera to the far plane. The far plane's

Implemented in open3d::visualization::rendering::FilamentCamera.

◆ SetupCameraAsPinholeCamera()

void open3d::visualization::rendering::Camera::SetupCameraAsPinholeCamera ( rendering::Camera camera,
const Eigen::Matrix3d &  intrinsic,
const Eigen::Matrix4d &  extrinsic,
int  intrinsic_width_px,
int  intrinsic_height_px,
const geometry::AxisAlignedBoundingBox scene_bounds 
)
static

Convenience function for configuring a camera as a pinhole camera. Configures the projection using the intrinsics and bounds, and the model matrix using the extrinsic matrix. Equivalent to calling SetProjection() and FromExtrinsics().

◆ Unproject()

virtual Eigen::Vector3f open3d::visualization::rendering::Camera::Unproject ( float  x,
float  y,
float  z,
float  view_width,
float  view_height 
) const
pure virtual

Returns world space coordinates given an x,y position in screen coordinates relative to upper left, the screen dimensions, and z is the depth value (0.0 - 1.0)

Implemented in open3d::visualization::rendering::FilamentCamera.


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