4#ifndef _SCENEPIC_CAMERA_H_
5#define _SCENEPIC_CAMERA_H_
28 double fov_y_degrees = 45.0,
29 double near_crop_distance = 0.01,
30 double far_crop_distance = 20.0,
42 double fov_y_degrees = 45.0,
43 double near_crop_distance = 0.01,
44 double far_crop_distance = 20.0,
63 const Vector&
center = Vector(0, 0, 4),
64 const Vector&
look_at = Vector(0, 0, 0),
65 const Vector&
up_dir = Vector(0, 1, 0),
66 double fov_y_degrees = 45.0,
67 double near_crop_distance = 0.01,
68 double far_crop_distance = 20.0,
133 float min_altitude = 0.25,
134 float max_altitude = 0.8,
135 Vector
up_dir = {0, 1, 0},
136 Vector forward_dir = {0, 0, 1},
137 double fov_y_degrees = 45.0,
139 double near_crop_distance = 0.01,
140 double far_crop_distance = 20.0);
A camera type.
Definition: camera.h:15
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.
Vector look_at() const
Where the camera is looking.
const Transform & projection() const
The GL project matrix, transforming from camera view coordinates to NDC.
Transform m_projection
Definition: camera.h:145
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.
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.
Transform rotation() const
The camera rotation matrix.
Vector up_dir() const
The direction that is "up" for the camera.
const Transform & camera_to_world() const
The transform placing the camera in the scene.
const Transform & world_to_camera() const
The transform placing the world in camera coordinates.
virtual JsonValue to_json() const
Convert this object into ScenePic json.
Transform m_world_to_camera
Definition: camera.h:144
Camera(const Transform &world_to_camera, const Transform &projection)
Constructor.
bool is_none() const
Whether this is a "no camera" instance.
std::string to_string() const
Return a JSON string representing the object.
float aspect_ratio() const
The aspect ratio of the camera projection.
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.
static Camera None()
A value indicating "no camera".
Transform m_camera_to_world
Definition: camera.h:143
Vector center() const
The camera center.
Camera & aspect_ratio(float aspect_ratio)
The aspect ratio of the camera projection.
Representation of a JSON value according to the specification at https://www.json....
Definition: json_value.h:30
Definition: audio_track.h:14