forked from monettomioka/Raytracer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Objects.pde
67 lines (60 loc) · 863 Bytes
/
Objects.pde
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
67
// Helper classes to store data globally
class Obj{
float x;
float y;
float z;
char type;
Surface sur;
}
public class Color{
float r;
float g;
float b;
}
public class Light{
float x;
float y;
float z;
float r;
float g;
float b;
}
public class Surface{
float Cdr;
float Cdg;
float Cdb;
float Car;
float Cag;
float Cab;
float Csr;
float Csg;
float Csb;
float P;
float K;
}
public class Triangle extends Obj{
PVector vec1;
PVector vec2;
PVector vec3;
Triangle(PVector a, PVector b, PVector c){
vec1 = a;
vec2 = b;
vec3 = c;
}
}
public class Hit{
PVector hitCoord;
Obj hitObj;
Surface sur;
PVector snormal;
float t;
}
public class Sphere extends Obj{
float r;
Sphere(float r, float x, float y, float z){
this.x = x;
this.y = y;
this.z = z;
this.r = r;
}
}