Geno3D
A simple 3D visualisation library, using C++/SFML.
 All Classes Functions Variables
Public Member Functions | Protected Attributes | List of all members
Geno3D::Camera Class Referenceabstract

#include <Camera.hpp>

Inheritance diagram for Geno3D::Camera:
Geno3D::Transformable Geno3D::OrthCamera Geno3D::PerspCamera

Public Member Functions

virtual Eigen::Matrix3Xf project (const Eigen::Matrix3Xf &points)=0
 
void translate (float x, float y, float z) override
 
void scale (float m) override
 
void rotate (float x, float y, float z) override
 
void transform (const Transformation &t) override
 
void setPosition (float x, float y, float z)
 
Eigen::Vector3f getPosition ()
 
void setOrientation (float x, float y, float z)
 
Eigen::Vector3f getOrientation ()
 
void setSurface (float x, float y, float z)
 
Eigen::Vector3f getSurface ()
 

Protected Attributes

Eigen::Vector3f position
 3D Position of the camera
 
Eigen::Vector3f orientation
 3D Orientation of the camera
 
Eigen::Vector3f displaySurface
 Configuration of the camera's display surface.
 

Detailed Description

The abstract camera class. To be used within a scene.

Member Function Documentation

Eigen::Vector3f Geno3D::Camera::getOrientation ( )
inline

Get the current 3D orientation of the camera.

See Also
setOrientation()
getPosition()
getSurface()

References orientation.

Eigen::Vector3f Geno3D::Camera::getPosition ( )
inline

Get the current position of the camera in 3D space.

See Also
setPosition()
getOrientation()
getSurface()

References position.

Eigen::Vector3f Geno3D::Camera::getSurface ( )
inline

Get the current configuration of the camera's display surface

See Also
setSurface()
getPosition()
getOrientation()

References displaySurface.

virtual Eigen::Matrix3Xf Geno3D::Camera::project ( const Eigen::Matrix3Xf &  points)
pure virtual

Project a set of points in 3D space onto the 2D camera. This should project the points onto the camera's display surface, using a projection algorithm e.g. Perspective or Orthographic projection.

Parameters
pointsa 3-row matrix holding points in 3D space
See Also
PerspCamera
OrthCamera

Implemented in Geno3D::OrthCamera, and Geno3D::PerspCamera.

void Geno3D::Camera::rotate ( float  x,
float  y,
float  z 
)
overridevirtual

Rotate by Euler angles, in radians.

Parameters
xthe angle to rotate by about the x-axis
ythe angle to rotate by about the y-axis
zthe angle to rotate by about the z-axis

Implements Geno3D::Transformable.

References orientation.

void Geno3D::Camera::scale ( float  m)
overridevirtual

Scale the position in 3D space by a factor.

Parameters
mthe factor to scale by

Implements Geno3D::Transformable.

References displaySurface.

void Geno3D::Camera::setOrientation ( float  x,
float  y,
float  z 
)

Set the 3D orientation of the camera.

Parameters
xthe orientation about the x-axis
ythe orientation about the y-axis
zthe orientation about the z-axis
See Also
getOrientation()
setPosition()
setSurface()

References orientation.

void Geno3D::Camera::setPosition ( float  x,
float  y,
float  z 
)

Set the position of the camera in 3D space.

Parameters
xthe position on the x-axis
ythe position on the y-axis
zthe position on the z-axis
See Also
getPosition()
setOrientation()
setSurface()

References position.

void Geno3D::Camera::setSurface ( float  x,
float  y,
float  z 
)

Configure the camera's display surface.

Parameters
xthe x-position of the surface. It is recommended to set this to half the width of the rendering window.
ythe y-position of the surface. It is recommended to set this to half the height of the rendering window.
zthe z-position of the surface. This acts as a scaling factor for the rendered image. It is recommended to set this to around half the height of the rendering window.
See Also
getSurface()
setPosition()
setOrientation()

References displaySurface.

void Geno3D::Camera::transform ( const Transformation t)
overridevirtual

Transform position and rotation of the camera by a compound transformation.

Parameters
tthe transformation to apply

Implements Geno3D::Transformable.

References Geno3D::Transformation::apply(), orientation, and position.

void Geno3D::Camera::translate ( float  x,
float  y,
float  z 
)
overridevirtual

Translate by a 3D vector.

Parameters
xthe amount to translate in the x-axis
ythe amount to translate in the y-axis
zthe amount to translate in the z-axis

Implements Geno3D::Transformable.

References position.


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