A camera type.
More...
#include <camera.h>
|
| | Camera (const Vector ¢er, const Transform &rotation, double fov_y_degrees=45.0, double near_crop_distance=0.01, double far_crop_distance=20.0, double aspect_ratio=1.0) |
| | Constructor. More...
|
| |
| | Camera (const Transform &world_to_camera, double fov_y_degrees=45.0, double near_crop_distance=0.01, double far_crop_distance=20.0, double aspect_ratio=1.0) |
| | Constructor. More...
|
| |
| | Camera (const Transform &world_to_camera, const Transform &projection) |
| | Constructor. More...
|
| |
| | Camera (const Vector ¢er=Vector(0, 0, 4), const Vector &look_at=Vector(0, 0, 0), const Vector &up_dir=Vector(0, 1, 0), double fov_y_degrees=45.0, double near_crop_distance=0.01, double far_crop_distance=20.0, double aspect_ratio=1.0) |
| | Constructor. More...
|
| |
| Transform | rotation () const |
| | The camera rotation matrix. More...
|
| |
| Vector | center () const |
| | The camera center. More...
|
| |
| Vector | look_at () const |
| | Where the camera is looking. More...
|
| |
| Vector | up_dir () const |
| | The direction that is "up" for the camera. More...
|
| |
| float | aspect_ratio () const |
| | The aspect ratio of the camera projection. More...
|
| |
| Camera & | aspect_ratio (float aspect_ratio) |
| | The aspect ratio of the camera projection. More...
|
| |
| const Transform & | camera_to_world () const |
| | The transform placing the camera in the scene. More...
|
| |
| const Transform & | world_to_camera () const |
| | The transform placing the world in camera coordinates. More...
|
| |
| const Transform & | projection () const |
| | The GL project matrix, transforming from camera view coordinates to NDC. More...
|
| |
| virtual JsonValue | to_json () const |
| | Convert this object into ScenePic json. More...
|
| |
| std::string | to_string () const |
| | Return a JSON string representing the object. More...
|
| |
| bool | is_none () const |
| | Whether this is a "no camera" instance. More...
|
| |
|
| static Camera | None () |
| | A value indicating "no camera". More...
|
| |
| static std::vector< Camera > | orbit (int num_frames, float distance, int num_times, float min_altitude=0.25, float max_altitude=0.8, Vector up_dir={0, 1, 0}, Vector forward_dir={0, 0, 1}, double fov_y_degrees=45.0, double aspect_ratio=1.0, double near_crop_distance=0.01, double far_crop_distance=20.0) |
| | Creates a sequence of cameras which move in an orbit around the origin. More...
|
| |
◆ Camera() [1/4]
| scenepic::Camera::Camera |
( |
const Vector & |
center, |
|
|
const Transform & |
rotation, |
|
|
double |
fov_y_degrees = 45.0, |
|
|
double |
near_crop_distance = 0.01, |
|
|
double |
far_crop_distance = 20.0, |
|
|
double |
aspect_ratio = 1.0 |
|
) |
| |
Constructor.
- Parameters
-
| center | the camera center in world coordinates |
| rotation | the camera rotation matrix |
| fov_y_degrees | vertical field of view in degrees |
| near_crop_distance | the near clipping plane of the view frustum |
| far_crop_distance | the far clipping plane of the view frustum |
| aspect_ratio | the aspect ratio of the image |
◆ Camera() [2/4]
| scenepic::Camera::Camera |
( |
const Transform & |
world_to_camera, |
|
|
double |
fov_y_degrees = 45.0, |
|
|
double |
near_crop_distance = 0.01, |
|
|
double |
far_crop_distance = 20.0, |
|
|
double |
aspect_ratio = 1.0 |
|
) |
| |
Constructor.
- Parameters
-
| world_to_camera | the world-to-camera transform. |
| fov_y_degrees | vertical field of view in degrees |
| near_crop_distance | the near clipping plane of the view frustum |
| far_crop_distance | the far clipping plane of the view frustum |
| aspect_ratio | the aspect ratio of the image |
◆ Camera() [3/4]
| scenepic::Camera::Camera |
( |
const Transform & |
world_to_camera, |
|
|
const Transform & |
projection |
|
) |
| |
Constructor.
- Parameters
-
| world_to_camera | the world-to-camera transform. |
| projection | matrix translating view coordinates to NDC |
◆ Camera() [4/4]
| scenepic::Camera::Camera |
( |
const Vector & |
center = Vector(0, 0, 4), |
|
|
const Vector & |
look_at = Vector(0, 0, 0), |
|
|
const Vector & |
up_dir = Vector(0, 1, 0), |
|
|
double |
fov_y_degrees = 45.0, |
|
|
double |
near_crop_distance = 0.01, |
|
|
double |
far_crop_distance = 20.0, |
|
|
double |
aspect_ratio = 1.0 |
|
) |
| |
Constructor.
- Parameters
-
| center | the camera center |
| look_at | where the camera is looking |
| up_dir | the direction that is "up" for the camera |
| fov_y_degrees | vertical field of view in degrees |
| near_crop_distance | the near clipping plane of the view frustum |
| far_crop_distance | the far clipping plane of the view frustum |
| aspect_ratio | the aspect ratio of the image |
◆ aspect_ratio() [1/2]
| float scenepic::Camera::aspect_ratio |
( |
| ) |
const |
The aspect ratio of the camera projection.
◆ aspect_ratio() [2/2]
| Camera & scenepic::Camera::aspect_ratio |
( |
float |
aspect_ratio | ) |
|
The aspect ratio of the camera projection.
◆ camera_to_world()
| const Transform & scenepic::Camera::camera_to_world |
( |
| ) |
const |
The transform placing the camera in the scene.
◆ center()
| Vector scenepic::Camera::center |
( |
| ) |
const |
◆ is_none()
| bool scenepic::Camera::is_none |
( |
| ) |
const |
Whether this is a "no camera" instance.
◆ look_at()
| Vector scenepic::Camera::look_at |
( |
| ) |
const |
Where the camera is looking.
◆ None()
| static Camera scenepic::Camera::None |
( |
| ) |
|
|
static |
A value indicating "no camera".
◆ orbit()
| static std::vector< Camera > scenepic::Camera::orbit |
( |
int |
num_frames, |
|
|
float |
distance, |
|
|
int |
num_times, |
|
|
float |
min_altitude = 0.25, |
|
|
float |
max_altitude = 0.8, |
|
|
Vector |
up_dir = {0, 1, 0}, |
|
|
Vector |
forward_dir = {0, 0, 1}, |
|
|
double |
fov_y_degrees = 45.0, |
|
|
double |
aspect_ratio = 1.0, |
|
|
double |
near_crop_distance = 0.01, |
|
|
double |
far_crop_distance = 20.0 |
|
) |
| |
|
static |
Creates a sequence of cameras which move in an orbit around the origin.
- Parameters
-
| num_frames | the number of frames in the sequence |
| distance | the distance of the camera from the origin |
| num_times | the number of times to orbit |
| min_altitude | the minimum altitude of the orbit |
| max_altitude | the maximum altitude of the orbit |
| up_dir | the direction that is up |
| forward_dir | the direction that is forward |
| fov_y_degrees | the field of view of the camera in degrees |
| aspect_ratio | the aspect ratio of the camera |
| near_crop_distance | the near clipping plane of the view frustum |
| far_crop_distance | the far clipping plane of the view frustum |
- Returns
- a sequence of cameras moving in an orbit
◆ projection()
| const Transform & scenepic::Camera::projection |
( |
| ) |
const |
The GL project matrix, transforming from camera view coordinates to NDC.
◆ rotation()
| Transform scenepic::Camera::rotation |
( |
| ) |
const |
The camera rotation matrix.
◆ to_json()
| virtual JsonValue scenepic::Camera::to_json |
( |
| ) |
const |
|
virtual |
Convert this object into ScenePic json.
- Returns
- a json value
◆ to_string()
| std::string scenepic::Camera::to_string |
( |
| ) |
const |
Return a JSON string representing the object.
◆ up_dir()
| Vector scenepic::Camera::up_dir |
( |
| ) |
const |
The direction that is "up" for the camera.
◆ world_to_camera()
| const Transform & scenepic::Camera::world_to_camera |
( |
| ) |
const |
The transform placing the world in camera coordinates.
◆ m_camera_to_world
| Transform scenepic::Camera::m_camera_to_world |
|
protected |
◆ m_projection
| Transform scenepic::Camera::m_projection |
|
protected |
◆ m_world_to_camera
| Transform scenepic::Camera::m_world_to_camera |
|
protected |
The documentation for this class was generated from the following file: