|
375 | 375 |
|
376 | 376 |
|
377 | 377 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
378 | | - const auto aspect_ratio = 16.0 / 9.0; |
379 | | - const int image_width = 400; |
380 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
381 | | - const int image_height = static_cast<int>(image_width / aspect_ratio); |
382 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
383 | | - const int samples_per_pixel = 100; |
| 378 | + auto aspect_ratio = 16.0 / 9.0; |
| 379 | + int image_width = 400; |
| 380 | + int samples_per_pixel = 100; |
384 | 381 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
385 | 382 | const int max_depth = 50; |
386 | 383 |
|
|
393 | 390 | vec3 vup(0,1,0); |
394 | 391 | auto dist_to_focus = 10.0; |
395 | 392 | auto aperture = 0.1; |
| 393 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
| 394 | + int image_height = static_cast<int>(image_width / aspect_ratio); |
396 | 395 |
|
397 | 396 |
|
398 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
399 | 397 | camera cam(lookfrom, lookat, vup, 20, aspect_ratio, aperture, dist_to_focus, 0.0, 1.0); |
400 | 398 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
401 | 399 | [Listing [scene-spheres-moving-camera]: <kbd>[main.cc]</kbd> Viewing parameters] |
|
1364 | 1362 |
|
1365 | 1363 | vec3 vup(0,1,0); |
1366 | 1364 | auto dist_to_focus = 10.0; |
| 1365 | + int image_height = static_cast<int>(image_width / aspect_ratio); |
1367 | 1366 |
|
1368 | 1367 | camera cam(lookfrom, lookat, vup, vfov, aspect_ratio, aperture, dist_to_focus, 0.0, 1.0); |
1369 | 1368 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
|
2483 | 2482 | ... |
2484 | 2483 | int main() { |
2485 | 2484 | ... |
2486 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
2487 | | - const int samples_per_pixel = 400; |
2488 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
2489 | | - ... |
2490 | 2485 | switch (0) { |
2491 | 2486 | ... |
2492 | 2487 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
2493 | 2488 | default: |
2494 | 2489 | case 5: |
2495 | 2490 | world = simple_light(); |
| 2491 | + samples_per_pixel = 400; |
2496 | 2492 | background = color(0,0,0); |
2497 | 2493 | lookfrom = point3(26,3,6); |
2498 | 2494 | lookat = point3(0,2,0); |
|
2655 | 2651 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
2656 | 2652 |
|
2657 | 2653 | int main() { |
2658 | | - // Image |
2659 | | - |
2660 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
2661 | | - const auto aspect_ratio = 1.0; |
2662 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
2663 | 2654 | ... |
2664 | 2655 | switch (0) { |
2665 | 2656 | ... |
|
2675 | 2666 | default: |
2676 | 2667 | case 6: |
2677 | 2668 | world = cornell_box(); |
| 2669 | + aspect_ratio = 1.0; |
| 2670 | + image_width = 600; |
| 2671 | + samples_per_pixel = 200; |
2678 | 2672 | background = color(0,0,0); |
2679 | 2673 | lookfrom = point3(278, 278, -800); |
2680 | 2674 | lookat = point3(278, 278, 0); |
|
3219 | 3213 | default: |
3220 | 3214 | case 7: |
3221 | 3215 | world = cornell_smoke(); |
| 3216 | + aspect_ratio = 1.0; |
| 3217 | + image_width = 600; |
| 3218 | + samples_per_pixel = 200; |
3222 | 3219 | lookfrom = point3(278, 278, -800); |
3223 | 3220 | lookat = point3(278, 278, 0); |
3224 | 3221 | vfov = 40.0; |
|
3312 | 3309 | } |
3313 | 3310 |
|
3314 | 3311 | int main() { |
3315 | | - // Image |
3316 | | - |
3317 | | - const auto aspect_ratio = 1.0; |
3318 | | - const int image_width = 800; |
3319 | | - const int image_height = static_cast<int>(image_width / aspect_ratio); |
3320 | | - const int samples_per_pixel = 10000; |
3321 | | - const int max_depth = 50; |
3322 | 3312 | ... |
3323 | | - |
3324 | | - default: |
3325 | | - case 8: |
3326 | | - world = final_scene(); |
3327 | | - background = color(0,0,0); |
3328 | | - lookfrom = point3(478, 278, -600); |
3329 | | - lookat = point3(278, 278, 0); |
3330 | | - vfov = 40.0; |
3331 | | - break; |
| 3313 | + switch (0) { |
| 3314 | + ... |
| 3315 | + default: |
| 3316 | + case 8: |
| 3317 | + world = final_scene(); |
| 3318 | + aspect_ratio = 1.0; |
| 3319 | + image_width = 800; |
| 3320 | + samples_per_pixel = 10000; |
| 3321 | + background = color(0,0,0); |
| 3322 | + lookfrom = point3(478, 278, -600); |
| 3323 | + lookat = point3(278, 278, 0); |
| 3324 | + vfov = 40.0; |
| 3325 | + break; |
3332 | 3326 | ... |
3333 | 3327 | } |
3334 | 3328 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
0 commit comments