-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcamera.h
26 lines (22 loc) · 804 Bytes
/
camera.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef __CAMERA_H__
#define __CAMERA_H__
#include "film.h"
class Camera
{
public:
vec3 position; // camera position
vec3 focal_point; // where the image plane is located
vec3 look_vector; // points from the position to the focal point - normalized
vec3 vertical_vector; // point up in the image plane - normalized
vec3 horizontal_vector; // points to the right on the image plane - normalized
Film film;
Camera()
:position(0,0,-1),focal_point(0,0,0),vertical_vector(0,1,0)
{}
void Position_And_Aim_Camera(const vec3& position_input,
const vec3& look_at_point,const vec3& pseudo_up_vector);
void Focus_Camera(double focal_distance,double aspect_ratio,
double field_of_view);
vec3 World_Position(const ivec2& pixel_index);
};
#endif