#include <Camera.hpp>
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. | |
The abstract camera class. To be used within a scene.
|
inline |
Get the current 3D orientation of the camera.
References orientation.
|
inline |
Get the current position of the camera in 3D space.
References position.
|
inline |
Get the current configuration of the camera's display surface
References displaySurface.
|
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.
points | a 3-row matrix holding points in 3D space |
Implemented in Geno3D::OrthCamera, and Geno3D::PerspCamera.
|
overridevirtual |
Rotate by Euler angles, in radians.
x | the angle to rotate by about the x-axis |
y | the angle to rotate by about the y-axis |
z | the angle to rotate by about the z-axis |
Implements Geno3D::Transformable.
References orientation.
|
overridevirtual |
Scale the position in 3D space by a factor.
m | the 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.
x | the orientation about the x-axis |
y | the orientation about the y-axis |
z | the orientation about the z-axis |
References orientation.
void Geno3D::Camera::setPosition | ( | float | x, |
float | y, | ||
float | z | ||
) |
Set the position of the camera in 3D space.
x | the position on the x-axis |
y | the position on the y-axis |
z | the position on the z-axis |
References position.
void Geno3D::Camera::setSurface | ( | float | x, |
float | y, | ||
float | z | ||
) |
Configure the camera's display surface.
x | the x-position of the surface. It is recommended to set this to half the width of the rendering window. |
y | the y-position of the surface. It is recommended to set this to half the height of the rendering window. |
z | the 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. |
References displaySurface.
|
overridevirtual |
Transform position and rotation of the camera by a compound transformation.
t | the transformation to apply |
Implements Geno3D::Transformable.
References Geno3D::Transformation::apply(), orientation, and position.
|
overridevirtual |
Translate by a 3D vector.
x | the amount to translate in the x-axis |
y | the amount to translate in the y-axis |
z | the amount to translate in the z-axis |
Implements Geno3D::Transformable.
References position.