65 //light2.colour = Colour(0.7, 0.3, 0.6); |
65 //light2.colour = Colour(0.7, 0.3, 0.6); |
66 //rt.addLight(&light2); |
66 //rt.addLight(&light2); |
67 |
67 |
68 Material mat0a(Colour(0.7, 0.7, 0.7)); |
68 Material mat0a(Colour(0.7, 0.7, 0.7)); |
69 mat0a. setReflectivity(0.0); |
69 mat0a. setReflectivity(0.0); |
70 Box box(Vector3(-10.0, -1.2, -20.0), Vector3(10.0, -1.0, 0.0), &mat0a); |
70 Box box(Vector(-10.0, -1.2, -20.0), Vector(10.0, -1.0, 0.0), &mat0a); |
71 rt.addShape(&box); |
71 rt.addShape(&box); |
72 |
72 |
73 Material mat0b(Colour(0.1, 0.7, 0.8)); |
73 Material mat0b(Colour(0.1, 0.7, 0.8)); |
74 mat0b.setReflectivity(0.7); |
74 mat0b.setReflectivity(0.7); |
75 Box box2(Vector3(-10.0, -1.2, -20.0), Vector3(10.0, 10.0, -20.2), &mat0b); |
75 Box box2(Vector(-10.0, -1.2, -20.0), Vector(10.0, 10.0, -20.2), &mat0b); |
76 rt.addShape(&box2); |
76 rt.addShape(&box2); |
77 |
77 |
78 Material mat1(Colour(1.0, 0.0, 0.0)); |
78 Material mat1(Colour(1.0, 0.0, 0.0)); |
79 Sphere bigsphere(Vector3(3.0, 2.0, -7.0), 3.0, &mat1); |
79 Sphere bigsphere(Vector(3.0, 2.0, -7.0), 3.0, &mat1); |
80 rt.addShape(&bigsphere); |
80 rt.addShape(&bigsphere); |
81 |
81 |
82 Material mat2(Colour(0.0, 1.0, 0.0)); |
82 Material mat2(Colour(0.0, 1.0, 0.0)); |
83 Sphere smallsphere(Vector3(-5.5, 1.5, -8.0), 2.0, &mat2); |
83 Sphere smallsphere(Vector(-5.5, 1.5, -8.0), 2.0, &mat2); |
84 rt.addShape(&smallsphere); |
84 rt.addShape(&smallsphere); |
85 |
85 |
86 Material mat3(Colour(0.0, 0.0, 1.0)); |
86 Material mat3(Colour(0.0, 0.0, 1.0)); |
87 mat3.setReflectivity(0.1); |
87 mat3.setReflectivity(0.1); |
88 mat3.setTransmissivity(0.8, 1.5); |
88 mat3.setTransmissivity(0.8, 1.5); |
89 Sphere tinysphere(Vector3(-1.2, 0.0, -2.0), 0.7, &mat3); |
89 Sphere tinysphere(Vector(-1.2, 0.0, -2.0), 0.7, &mat3); |
90 rt.addShape(&tinysphere); |
90 rt.addShape(&tinysphere); |
91 |
91 |
92 top.optimize(); |
92 top.optimize(); |
93 |
93 |
94 cam.setEye(Vector3(-2.28908, 4.30992, 12.3051)); |
94 cam.setEye(Vector(-2.28908, 4.30992, 12.3051)); |
95 cam.p = Vector3(0.0988566, -0.139543, -0.985269); |
95 cam.p = Vector(0.0988566, -0.139543, -0.985269); |
96 cam.u = Vector3(-0.995004, 0, -0.0998334); |
96 cam.u = Vector(-0.995004, 0, -0.0998334); |
97 cam.v = Vector3(0.0139311, 0.990216, -0.138846); |
97 cam.v = Vector(0.0139311, 0.990216, -0.138846); |
98 rt.setCamera(&cam); |
98 rt.setCamera(&cam); |
99 |
99 |
100 w = 800; |
100 w = 800; |
101 h = 600; |
101 h = 600; |
102 |
102 |