-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscene.bash
55 lines (52 loc) · 1.03 KB
/
scene.bash
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
# shellcheck disable=SC2034
# Background colour
bg_col="55 163 212"
# Lights
declare -Ag lt_light0=(
[col]="255 255 255"
[dir]="-2 0.2 -1"
[type]="dir"
)
declare -Ag lt_light1=(
[col]="255 255 255"
[location]="2 7 8"
[type]="point"
)
# Objects
declare -Ag obj_sphere0=(
[origin]="0.2 3 1.1"
[radius]=1.25
[col]="147 244 136"
[intersect]=intersect_sphere
)
declare -Ag obj_sphere1=(
[origin]="-1.5 4 0.3"
[radius]=1.2
[col]="161 214 220"
[intersect]=intersect_sphere
)
declare -Ag obj_triangle0=(
[p0]="-10 0 -1.2"
[p1]="2.75 10 -1.2"
[p2]="-10 10 -1.2"
[col1]="195 38 0"
[col2]="248 231 44"
[intersect]=intersect_triangle
[pattern]=checker
)
declare -Ag obj_triangle1=(
[p0]="-10 0 -1.2"
[p1]="2.75 0 -1.2"
[p2]="2.75 10 -1.2"
[col1]="195 38 0"
[col2]="248 231 44"
[intersect]=intersect_triangle
[pattern]=checker
)
# Camera-to-world matrix
declare -Ag cam_to_world=(
[0, 0]=1 [0, 1]=0 [0, 2]=0 [0, 3]=0
[1, 0]=0 [1, 1]=0 [1, 2]=1 [1, 3]=0
[2, 0]=0 [2, 1]=-1 [2, 2]=0 [2, 3]=0
[3, 0]=0 [3, 1]=0 [3, 2]=1 [3, 3]=1
)