@@ -160,7 +160,7 @@ hittable_list cornell_box() {
160160 objects.add (make_shared<xy_rect>(0 , 555 , 0 , 555 , 555 , white));
161161
162162 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 );
164164 box1 = make_shared<translate>(box1, vec3 (265 ,0 ,295 ));
165165 objects.add (box1);
166166
@@ -173,34 +173,6 @@ hittable_list cornell_box() {
173173}
174174
175175
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-
204176hittable_list cornell_smoke () {
205177 hittable_list objects;
206178
@@ -217,7 +189,7 @@ hittable_list cornell_smoke() {
217189 objects.add (make_shared<xy_rect>(0 , 555 , 0 , 555 , 555 , white));
218190
219191 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 );
221193 box1 = make_shared<translate>(box1, vec3 (265 ,0 ,295 ));
222194
223195 shared_ptr<hittable> box2 = make_shared<box>(point3 (0 ,0 ,0 ), point3 (165 ,165 ,165 ), white);
@@ -231,37 +203,6 @@ hittable_list cornell_smoke() {
231203}
232204
233205
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-
265206hittable_list final_scene () {
266207 hittable_list boxes1;
267208 auto ground = make_shared<lambertian>(color (0.48 , 0.83 , 0.53 ));
@@ -397,27 +338,13 @@ int main() {
397338 break ;
398339
399340 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 :
407341 world = cornell_smoke ();
408342 lookfrom = point3 (278 , 278 , -800 );
409343 lookat = point3 (278 , 278 , 0 );
410344 vfov = 40.0 ;
411345 break ;
412346
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 :
421348 world = final_scene ();
422349 lookfrom = point3 (478 , 278 , -600 );
423350 lookat = point3 (278 , 278 , 0 );
0 commit comments