|
1547 | 1547 | <div class='together'>
|
1548 | 1548 | Main is also changed:
|
1549 | 1549 |
|
| 1550 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
| 1551 | + #include "rtweekend.h" |
| 1552 | + |
| 1553 | + |
1550 | 1554 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
|
1551 | 1555 | #include "camera.h"
|
1552 | 1556 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
|
| 1557 | + #include "color.h" |
| 1558 | + #include "hittable_list.h" |
| 1559 | + #include "sphere.h" |
| 1560 | + |
| 1561 | + #include <iostream> |
1553 | 1562 |
|
1554 | 1563 | ...
|
1555 | 1564 |
|
|
2292 | 2301 | Now let’s add some metal spheres to our scene:
|
2293 | 2302 |
|
2294 | 2303 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
|
2295 |
| - ... |
2296 |
| - |
| 2304 | + #include "rtweekend.h" |
2297 | 2305 |
|
| 2306 | + #include "camera.h" |
| 2307 | + #include "color.h" |
| 2308 | + #include "hittable_list.h" |
2298 | 2309 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
|
2299 | 2310 | #include "material.h"
|
2300 | 2311 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
|
| 2312 | + #include "sphere.h" |
| 2313 | + |
| 2314 | + #include <iostream> |
2301 | 2315 |
|
2302 | 2316 | ...
|
2303 | 2317 |
|
|
2860 | 2874 | #include "color.h"
|
2861 | 2875 | #include "hittable_list.h"
|
2862 | 2876 | #include "material.h"
|
| 2877 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
2863 | 2878 | #include "scene.h"
|
| 2879 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
2864 | 2880 | #include "sphere.h"
|
2865 | 2881 |
|
2866 | 2882 | int main() {
|
| 2883 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
2867 | 2884 | scene scene_desc;
|
| 2885 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
2868 | 2886 |
|
2869 | 2887 | const double aspect_ratio = 16.0 / 9.0;
|
2870 | 2888 |
|
| 2889 | + |
| 2890 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
2871 | 2891 | scene_desc.image_width = 400;
|
2872 | 2892 | scene_desc.image_height = static_cast<int>(scene_desc.image_width / aspect_ratio);
|
2873 | 2893 | scene_desc.samples_per_pixel = 100;
|
2874 | 2894 |
|
2875 | 2895 | hittable_list& world = scene_desc.world;
|
| 2896 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
2876 | 2897 |
|
2877 | 2898 | auto material_ground = make_shared<lambertian>(color(0.8, 0.8, 0.0));
|
2878 | 2899 | auto material_center = make_shared<lambertian>(color(0.1, 0.2, 0.5));
|
|
2885 | 2906 | world.add(make_shared<sphere>(point3(-1.0, 0.0, -1.0), -0.4, material_left));
|
2886 | 2907 | world.add(make_shared<sphere>(point3( 1.0, 0.0, -1.0), 0.5, material_right));
|
2887 | 2908 |
|
| 2909 | + |
| 2910 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
2888 | 2911 | scene_desc.render();
|
| 2912 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
2889 | 2913 | }
|
2890 | 2914 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2891 | 2915 | [Listing [main-with-scene]: <kdb>[main.cc]</kbd> main.cc using the new scene class]
|
|
0 commit comments