-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjects.cpp
More file actions
60 lines (53 loc) · 1010 Bytes
/
Copy pathobjects.cpp
File metadata and controls
60 lines (53 loc) · 1010 Bytes
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
#ifndef OBJ
#define OBJ
#include "vector.cpp"
enum Materials{
opaque,
miror,
transparent
};
class Sphere{
public:
Sphere(Vector& center, double r, Vector& color, Materials material=opaque){
R = r;
p = center;
c = color;
m = material;
}
Vector p, c;
double R;
Materials m;
};
class Ray {
public:
Ray(Vector& point, Vector& direction){
p = point;
d = direction;
}
Vector p, d;
};
class Camera {
public:
Camera(){}
Camera(Vector& point, double fieldOfView, double aperatureRad=.1){
p = point;
fov = fieldOfView;
f = w/(2.*tan(fov/2.*PI/180.));
R = aperatureRad;
}
Vector p;
double fov, f, R;
};
class Light {
public:
Light(){}
Light(Vector& point, int intensity, double radius){
p = point;
I = intensity;
R = radius;
}
Vector p;
double R;
int I;
};
#endif