@@ -160,7 +160,7 @@ hittable_list cornell_box() {
160
160
objects.add (make_shared<xy_rect>(0 , 555 , 0 , 555 , 555 , white));
161
161
162
162
shared_ptr<hittable> box1 = make_shared<box>(point3 (0 ,0 ,0 ), point3 (165 ,330 ,165 ), white);
163
- box1 = make_shared<rotate_y>(box1, 15 );
163
+ box1 = make_shared<rotate_y>(box1, 15 );
164
164
box1 = make_shared<translate>(box1, vec3 (265 ,0 ,295 ));
165
165
objects.add (box1);
166
166
@@ -173,34 +173,6 @@ hittable_list cornell_box() {
173
173
}
174
174
175
175
176
- hittable_list cornell_balls () {
177
- hittable_list objects;
178
-
179
- auto red = make_shared<lambertian>(color (.65 , .05 , .05 ));
180
- auto white = make_shared<lambertian>(color (.73 , .73 , .73 ));
181
- auto green = make_shared<lambertian>(color (.12 , .45 , .15 ));
182
- auto light = make_shared<diffuse_light>(color (5 , 5 , 5 ));
183
-
184
- objects.add (make_shared<yz_rect>(0 , 555 , 0 , 555 , 555 , green));
185
- objects.add (make_shared<yz_rect>(0 , 555 , 0 , 555 , 0 , red));
186
- objects.add (make_shared<xz_rect>(113 , 443 , 127 , 432 , 554 , light));
187
- objects.add (make_shared<xz_rect>(0 , 555 , 0 , 555 , 555 , white));
188
- objects.add (make_shared<xz_rect>(0 , 555 , 0 , 555 , 0 , white));
189
- objects.add (make_shared<xy_rect>(0 , 555 , 0 , 555 , 555 , white));
190
-
191
- auto boundary = make_shared<sphere>(point3 (160 ,100 ,145 ), 100 , make_shared<dielectric>(1.5 ));
192
- objects.add (boundary);
193
- objects.add (make_shared<constant_medium>(boundary, 0.1 , color (1 ,1 ,1 )));
194
-
195
- shared_ptr<hittable> box1 = make_shared<box>(point3 (0 ,0 ,0 ), point3 (165 ,330 ,165 ), white);
196
- box1 = make_shared<rotate_y>(box1, 15 );
197
- box1 = make_shared<translate>(box1, vec3 (265 ,0 ,295 ));
198
- objects.add (box1);
199
-
200
- return objects;
201
- }
202
-
203
-
204
176
hittable_list cornell_smoke () {
205
177
hittable_list objects;
206
178
@@ -217,7 +189,7 @@ hittable_list cornell_smoke() {
217
189
objects.add (make_shared<xy_rect>(0 , 555 , 0 , 555 , 555 , white));
218
190
219
191
shared_ptr<hittable> box1 = make_shared<box>(point3 (0 ,0 ,0 ), point3 (165 ,330 ,165 ), white);
220
- box1 = make_shared<rotate_y>(box1, 15 );
192
+ box1 = make_shared<rotate_y>(box1, 15 );
221
193
box1 = make_shared<translate>(box1, vec3 (265 ,0 ,295 ));
222
194
223
195
shared_ptr<hittable> box2 = make_shared<box>(point3 (0 ,0 ,0 ), point3 (165 ,165 ,165 ), white);
@@ -231,37 +203,6 @@ hittable_list cornell_smoke() {
231
203
}
232
204
233
205
234
- hittable_list cornell_final () {
235
- hittable_list objects;
236
-
237
- auto pertext = make_shared<noise_texture>(0.1 );
238
-
239
- auto mat = make_shared<lambertian>(make_shared<image_texture>(" earthmap.jpg" ));
240
-
241
- auto red = make_shared<lambertian>(color (.65 , .05 , .05 ));
242
- auto white = make_shared<lambertian>(color (.73 , .73 , .73 ));
243
- auto green = make_shared<lambertian>(color (.12 , .45 , .15 ));
244
- auto light = make_shared<diffuse_light>(color (7 , 7 , 7 ));
245
-
246
- objects.add (make_shared<yz_rect>(0 , 555 , 0 , 555 , 555 , green));
247
- objects.add (make_shared<yz_rect>(0 , 555 , 0 , 555 , 0 , red));
248
- objects.add (make_shared<xz_rect>(123 , 423 , 147 , 412 , 554 , light));
249
- objects.add (make_shared<xz_rect>(0 , 555 , 0 , 555 , 555 , white));
250
- objects.add (make_shared<xz_rect>(0 , 555 , 0 , 555 , 0 , white));
251
- objects.add (make_shared<xy_rect>(0 , 555 , 0 , 555 , 555 , white));
252
-
253
- shared_ptr<hittable> boundary2 =
254
- make_shared<box>(point3 (0 ,0 ,0 ), point3 (165 ,165 ,165 ), make_shared<dielectric>(1.5 ));
255
- boundary2 = make_shared<rotate_y>(boundary2, -18 );
256
- boundary2 = make_shared<translate>(boundary2, vec3 (130 ,0 ,65 ));
257
-
258
- objects.add (boundary2);
259
- objects.add (make_shared<constant_medium>(boundary2, 0.2 , color (0.9 , 0.9 , 0.9 )));
260
-
261
- return objects;
262
- }
263
-
264
-
265
206
hittable_list final_scene () {
266
207
hittable_list boxes1;
267
208
auto ground = make_shared<lambertian>(color (0.48 , 0.83 , 0.53 ));
@@ -397,27 +338,13 @@ int main() {
397
338
break ;
398
339
399
340
case 7 :
400
- world = cornell_balls ();
401
- lookfrom = point3 (278 , 278 , -800 );
402
- lookat = point3 (278 , 278 , 0 );
403
- vfov = 40.0 ;
404
- break ;
405
-
406
- case 8 :
407
341
world = cornell_smoke ();
408
342
lookfrom = point3 (278 , 278 , -800 );
409
343
lookat = point3 (278 , 278 , 0 );
410
344
vfov = 40.0 ;
411
345
break ;
412
346
413
- case 9 :
414
- world = cornell_final ();
415
- lookfrom = point3 (278 , 278 , -800 );
416
- lookat = point3 (278 , 278 , 0 );
417
- vfov = 40.0 ;
418
- break ;
419
-
420
- case 10 :
347
+ case 8 :
421
348
world = final_scene ();
422
349
lookfrom = point3 (478 , 278 , -600 );
423
350
lookat = point3 (278 , 278 , 0 );
0 commit comments