-
Notifications
You must be signed in to change notification settings - Fork 0
/
camera.cpp
66 lines (53 loc) · 1.02 KB
/
camera.cpp
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "camera.h"
using namespace std;
Camera::Camera() {
Vector temp(0.0,0.0,0.0);
Vector temp2(0.0,0.0);
Vector3d vp(temp);
Vector2d sa(temp2);
vPoint = vp;
vDir = vp;
vUp = vp;
focal = 0.0;
aspect = 0.0;
screen = sa;
}
Camera::Camera(Vector v1, Vector v2, Vector v3, double f, double a, double sw) {
Vector3d vp(v1);
Vector3d vd(v2);
Vector3d vu(v3);
vPoint = vp;
vDir = vd;
vUp = vu;
focal = f;
aspect = a;
Vector temp(sw, (sw/a));
Vector2d ss(temp);
screen = ss;
}
void Camera::set(Vector v1, Vector v2, Vector v3, double f, double a, double sw) {
Vector3d vp(v1);
Vector3d vd(v2);
Vector3d vu(v3);
vPoint = vp;
vDir = vd;
vUp = vu;
focal = f;
aspect = a;
Vector temp(sw, (sw/a));
Vector2d ss(temp);
screen = ss;
}
void Camera::set(Vector *v1, Vector *v2, Vector *v3, double f, double a, double sw) {
Vector3d vp(*v1);
Vector3d vd(*v2);
Vector3d vu(*v3);
vPoint = vp;
vDir = vd;
vUp = vu;
focal = f;
aspect = a;
Vector temp(sw, (sw/a));
Vector2d ss(temp);
screen = ss;
}