61 rt.setTop(&top); |
61 rt.setTop(&top); |
62 |
62 |
63 rt.addLight(&light); |
63 rt.addLight(&light); |
64 light.castShadows(false); |
64 light.castShadows(false); |
65 |
65 |
66 Material mat0a(Colour(0.7, 0.7, 0.7)); |
66 const Colour c_white(1, 1, 1); |
67 mat0a.setReflectivity(0.0); |
67 const Colour c_black(0, 0, 0); |
68 Box box(Vector(-12.0, -1.2, -20.0), Vector(12.0, -1.0, 0.0), &mat0a); |
68 |
|
69 Material mat0a(Colour(0.7f, 0.7f, 0.7f)); |
|
70 mat0a.setReflectivity(0.0f); |
|
71 Box box(Vector(-12.0f, -1.2f, -20.0f), Vector(12.0f, -1.0f, 0.0f), &mat0a); |
69 rt.addShape(&box); |
72 rt.addShape(&box); |
70 |
73 |
71 Material mat0b(Colour(0.1, 0.7, 0.8)); |
74 Material mat0b(Colour(0.1f, 0.7f, 0.8f)); |
72 mat0b.setReflectivity(0.7); |
75 mat0b.setReflectivity(0.7f); |
73 Box box2(Vector(-12.0, -1.2, -10.0), Vector(12.0, 10.0, -10.2), &mat0b); |
76 Box box2(Vector(-12.0f, -1.2f, -10.0f), Vector(12.0f, 10.0f, -10.2f), &mat0b); |
74 rt.addShape(&box2); |
77 rt.addShape(&box2); |
75 |
78 |
76 Float bounds[] = {0.3, 0.6, 1.1}; |
79 Float bounds[] = {0.3f, 0.6f, 1.1f}; |
77 Colour colours[] = {Colour(0,0,0), Colour(1,1,1), Colour(0,0,0)}; |
80 Colour colours[] = {c_black, c_white, c_black}; |
78 BoundColourMap cmap(bounds, colours); |
81 BoundColourMap cmap(bounds, colours); |
79 |
82 |
80 // spheres |
83 // spheres |
81 Material mat1(Colour(1.0, 1.0, 1.0)); |
84 Material mat1(c_white); |
82 mat1.texture = new CheckersTexture(new PlanarMap(Vector(-4.5, 2.0, -7.0), 0.48), &cmap); |
85 mat1.texture = new CheckersTexture(new PlanarMap(Vector(-4.5f, 2.0f, -7.0f), 0.48f), &cmap); |
83 Sphere sphere1(Vector(-4.5, 2.0, -7.0), 1.0, &mat1); |
86 Sphere sphere1(Vector(-4.5f, 2.0f, -7.0f), 1, &mat1); |
84 rt.addShape(&sphere1); |
87 rt.addShape(&sphere1); |
85 |
88 |
86 Material mat2(Colour(1.0, 1.0, 1.0)); |
89 Material mat2(c_white); |
87 mat2.texture = new CheckersTexture(new CubicMap(Vector(-1.5, 2.0, -7.0), 0.48), &cmap); |
90 mat2.texture = new CheckersTexture(new CubicMap(Vector(-1.5f, 2.0f, -7.0f), 0.48f), &cmap); |
88 Sphere sphere2(Vector(-1.5, 2.0, -7.0), 1.0, &mat2); |
91 Sphere sphere2(Vector(-1.5f, 2.0f, -7.0f), 1, &mat2); |
89 rt.addShape(&sphere2); |
92 rt.addShape(&sphere2); |
90 |
93 |
91 Material mat3(Colour(1.0, 1.0, 1.0)); |
94 Material mat3(c_white); |
92 mat3.texture = new CheckersTexture(new CylinderMap(Vector(1.5, 2.0, -7.0), 0.48), &cmap); |
95 mat3.texture = new CheckersTexture(new CylinderMap(Vector(1.5f, 2.0f, -7.0f), 0.48f), &cmap); |
93 Sphere sphere3(Vector(1.5, 2.0, -7.0), 1.0, &mat3); |
96 Sphere sphere3(Vector(1.5f, 2.0f, -7.0f), 1, &mat3); |
94 rt.addShape(&sphere3); |
97 rt.addShape(&sphere3); |
95 |
98 |
96 Material mat4(Colour(1.0, 1.0, 1.0)); |
99 Material mat4(c_white); |
97 mat4.texture = new CheckersTexture(new SphereMap(Vector(4.5, 2.0, -7.0), 0.48), &cmap); |
100 mat4.texture = new CheckersTexture(new SphereMap(Vector(4.5f, 2.0f, -7.0f), 0.48f), &cmap); |
98 Sphere sphere4(Vector(4.5, 2.0, -7.0), 1.0, &mat4); |
101 Sphere sphere4(Vector(4.5f, 2.0f, -7.0f), 1, &mat4); |
99 rt.addShape(&sphere4); |
102 rt.addShape(&sphere4); |
100 |
103 |
101 // cubes |
104 // cubes |
102 Material mat5(Colour(1.0, 1.0, 1.0)); |
105 Material mat5(c_white); |
103 mat5.texture = new CheckersTexture(new PlanarMap(Vector(-4.5, 0.0, -7.0), 0.48), &cmap); |
106 const Vector cube1_base(-4.5f, 0.0f, -7.0f); |
104 Box cube1(Vector(-4.5, 0.0, -7.0)-1.0, Vector(-4.5, 0.0, -7.0)+1.0, &mat5); |
107 mat5.texture = new CheckersTexture(new PlanarMap(cube1_base, 0.48f), &cmap); |
|
108 Box cube1(cube1_base - 1.0f, cube1_base + 1.0f, &mat5); |
105 rt.addShape(&cube1); |
109 rt.addShape(&cube1); |
106 |
110 |
107 Material mat6(Colour(1.0, 1.0, 1.0)); |
111 Material mat6(c_white); |
108 mat6.texture = new CheckersTexture(new CubicMap(Vector(-1.5, 0.0, -7.0), 0.48), &cmap); |
112 const Vector cube2_base(-1.5f, 0.0f, -7.0f); |
109 Box cube2(Vector(-1.5, 0.0, -7.0)-1.0, Vector(-1.5, 0.0, -7.0)+1.0, &mat6); |
113 mat6.texture = new CheckersTexture(new CubicMap(cube2_base, 0.48f), &cmap); |
|
114 Box cube2(cube2_base - 1.0f, cube2_base + 1.0f, &mat6); |
110 rt.addShape(&cube2); |
115 rt.addShape(&cube2); |
111 |
116 |
112 Material mat7(Colour(1.0, 1.0, 1.0)); |
117 Material mat7(c_white); |
113 mat7.texture = new CheckersTexture(new CylinderMap(Vector(1.5, 0.0, -7.0), 0.48), &cmap); |
118 const Vector cube3_base(1.5f, 0.0f, -7.0f); |
114 Box cube3(Vector(1.5, 0.0, -7.0)-1.0, Vector(1.5, 0.0, -7.0)+1.0, &mat7); |
119 mat7.texture = new CheckersTexture(new CylinderMap(cube3_base, 0.48f), &cmap); |
|
120 Box cube3(cube3_base - 1.0f, cube3_base + 1.0f, &mat7); |
115 rt.addShape(&cube3); |
121 rt.addShape(&cube3); |
116 |
122 |
117 Material mat8(Colour(1.0, 1.0, 1.0)); |
123 Material mat8(c_white); |
118 mat8.texture = new CheckersTexture(new SphereMap(Vector(4.5, 0.0, -7.0), 0.48), &cmap); |
124 const Vector cube4_base(4.5f, 0.0f, -7.0f); |
119 Box cube4(Vector(4.5, 0.0, -7.0)-1.0, Vector(4.5, 0.0, -7.0)+1.0, &mat8); |
125 mat8.texture = new CheckersTexture(new SphereMap(cube4_base, 0.48f), &cmap); |
|
126 Box cube4(cube4_base - 1.0f, cube4_base + 1.0f, &mat8); |
120 rt.addShape(&cube4); |
127 rt.addShape(&cube4); |
121 |
128 |
122 mat1.setReflectivity(0); |
129 mat1.setReflectivity(0); |
123 mat2.setReflectivity(0); |
130 mat2.setReflectivity(0); |
124 mat3.setReflectivity(0); |
131 mat3.setReflectivity(0); |