-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscene2.test
93 lines (76 loc) · 1.88 KB
/
scene2.test
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Test Scene 2
# A simple scene to test ray-surface intersections
# This defines a simple dice
# There are no transformations in this scene
# Note that I use ambient to set the color of the various materials.
# It is unlikely that a ray tracing program will be able to do the same or
# indeed to interpret multiple instances of the ambient keyword.
# To get the same effect, you can assign manually a color to each group of
# primitives. In any case, getting the geometry right is the point of this
# exercise, not the shading.
size 640 480
# There are 3 camera positions. Make images for all 3
camera -2 -2 2 0 0 0 1 1 2 60
#camera +2 +2 2 0 0 0 -1 -1 2 60
#camera -2 -2 -2 0 0 0 -1 -1 2 60
# Now specify the geometry. First the cube, then the spheres
maxverts 8
vertex -1 -1 -1
vertex +1 -1 -1
vertex +1 +1 -1
vertex -1 +1 -1
vertex -1 -1 +1
vertex +1 -1 +1
vertex +1 +1 +1
vertex -1 +1 +1
# Now, I actually define the cube. Note that to avoid lighting/material
# calculations, I am just using ambient to define the colors.
# No lighting calculations should be performed since I haven't defined any
# lights.
ambient .5 0 .5
# face -Y
tri 0 1 5
tri 0 5 4
ambient .5 1 .5
# face +Y
tri 3 7 6
tri 3 6 2
ambient 1 .5 .5
# face +X
tri 1 2 6
tri 1 6 5
ambient 0 .5 .5
# face -X
tri 0 7 3
tri 0 4 7
ambient .5 .5 0
# face -Z
tri 0 3 2
tri 0 2 1
ambient .5 .5 1
# face +Z
tri 4 5 6
tri 4 6 7
# Make spheres
ambient 1 1 1
sphere 1 0 0 0.15
sphere -.5 1 -.5 0.15
sphere +.5 1 +.5 0.15
sphere 0 0 1 0.15
sphere -.5 -.5 1 0.15
sphere +.5 +.5 1 0.15
sphere -1 -.5 -.5 0.15
sphere -1 -.5 +.5 0.15
sphere -1 +.5 +.5 0.15
sphere -1 +.5 -.5 0.15
sphere -.5 -1 -.5 0.15
sphere -.5 -1 +.5 0.15
sphere +.5 -1 +.5 0.15
sphere +.5 -1 -.5 0.15
sphere 0 -1 0 0.15
sphere -.5 -.5 -1 0.15
sphere -.5 0 -1 0.15
sphere -.5 +.5 -1 0.15
sphere +.5 -.5 -1 0.15
sphere +.5 0 -1 0.15
sphere +.5 +.5 -1 0.15