|
600 | 600 | #ifndef AABB_H |
601 | 601 | #define AABB_H |
602 | 602 |
|
603 | | - #include "rtweekend.h" |
604 | | - |
605 | 603 | class aabb { |
606 | 604 | public: |
607 | 605 | interval x, y, z; |
|
675 | 673 | Finally, recall that some objects may be animated. Such objects should return their bounds over the |
676 | 674 | entire range of motion, from time=0 to time=1. |
677 | 675 |
|
678 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
679 | | - ... |
680 | | - #include "rtweekend.h" |
681 | | - |
682 | | - |
683 | 676 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
684 | 677 | #include "aabb.h" |
685 | 678 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
|
827 | 820 | Now we'll update the `hittable_list` object, computing the bounds of its children. We'll update the |
828 | 821 | bounding box incrementally as each new child is added. |
829 | 822 |
|
830 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
831 | | - #include "rtweekend.h" |
832 | | - |
833 | | - |
834 | 823 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
835 | 824 | #include "aabb.h" |
836 | 825 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
|
881 | 870 | #ifndef BVH_H |
882 | 871 | #define BVH_H |
883 | 872 |
|
884 | | - #include "rtweekend.h" |
885 | | - |
886 | 873 | #include "aabb.h" |
887 | 874 | #include "hittable.h" |
888 | 875 | #include "hittable_list.h" |
|
946 | 933 | we haven't yet defined. |
947 | 934 |
|
948 | 935 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
949 | | - #include "rtweekend.h" |
950 | | - |
951 | 936 | #include "aabb.h" |
952 | 937 | #include "hittable.h" |
953 | 938 | #include "hittable_list.h" |
|
1228 | 1213 | #ifndef TEXTURE_H |
1229 | 1214 | #define TEXTURE_H |
1230 | 1215 |
|
1231 | | - #include "rtweekend.h" |
1232 | | - |
1233 | 1216 | class texture { |
1234 | 1217 | public: |
1235 | 1218 | virtual ~texture() = default; |
|
1337 | 1320 | colors: |
1338 | 1321 |
|
1339 | 1322 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
1340 | | - #include "rtweekend.h" |
1341 | | - |
1342 | 1323 | #include "hittable.h" |
1343 | 1324 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
1344 | 1325 | #include "texture.h" |
|
1825 | 1806 | <div class='together'> |
1826 | 1807 | The `image_texture` class uses the `rtw_image` class: |
1827 | 1808 |
|
1828 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
1829 | | - #include "rtweekend.h" |
1830 | | - |
1831 | | - |
1832 | 1809 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
1833 | 1810 | #include "rtw_stb_image.h" |
1834 | 1811 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
|
1968 | 1945 | #ifndef PERLIN_H |
1969 | 1946 | #define PERLIN_H |
1970 | 1947 |
|
1971 | | - #include "rtweekend.h" |
1972 | | - |
1973 | 1948 | class perlin { |
1974 | 1949 | public: |
1975 | 1950 | perlin() { |
|
2023 | 1998 | <div class='together'> |
2024 | 1999 | Now if we create an actual texture that takes these floats between 0 and 1 and creates grey colors: |
2025 | 2000 |
|
2026 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
2027 | | - #include "rtweekend.h" |
2028 | | - |
2029 | | - |
2030 | 2001 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
2031 | 2002 | #include "perlin.h" |
2032 | 2003 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
|
2623 | 2594 | #ifndef QUAD_H |
2624 | 2595 | #define QUAD_H |
2625 | 2596 |
|
2626 | | - #include "rtweekend.h" |
2627 | | - |
2628 | 2597 | #include "hittable.h" |
2629 | 2598 |
|
2630 | 2599 | class quad : public hittable { |
|
2817 | 2786 | } |
2818 | 2787 |
|
2819 | 2788 | ... |
| 2789 | + } |
2820 | 2790 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
2821 | 2791 | [Listing [quad-plane2]: <kbd>[quad.h]</kbd> hit() method for the infinite plane] |
2822 | 2792 |
|
|
2882 | 2852 |
|
2883 | 2853 | set_bounding_box(); |
2884 | 2854 | } |
| 2855 | + |
2885 | 2856 | ... |
2886 | 2857 |
|
2887 | 2858 | private: |
|
3068 | 3039 | vec3 normal; |
3069 | 3040 | double D; |
3070 | 3041 | }; |
3071 | | - |
3072 | | - #endif |
3073 | 3042 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
3074 | 3043 | [Listing [quad-final]: <kbd>[quad.h]</kbd> Final quad class] |
3075 | 3044 |
|
|
3522 | 3491 | create a function that returns a box, by creating a `hittable_list` of six rectangles: |
3523 | 3492 |
|
3524 | 3493 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
3525 | | - #include "rtweekend.h" |
3526 | | - |
3527 | 3494 | #include "hittable.h" |
3528 | 3495 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
3529 | 3496 | #include "hittable_list.h" |
|
3989 | 3956 | #ifndef CONSTANT_MEDIUM_H |
3990 | 3957 | #define CONSTANT_MEDIUM_H |
3991 | 3958 |
|
3992 | | - #include "rtweekend.h" |
3993 | | - |
3994 | 3959 | #include "hittable.h" |
3995 | 3960 | #include "material.h" |
3996 | 3961 | #include "texture.h" |
|
4103 | 4068 | bigger (and dimmer so it doesn’t blow out the scene) for faster convergence: |
4104 | 4069 |
|
4105 | 4070 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ |
4106 | | - #include "rtweekend.h" |
4107 | | - |
4108 | 4071 | #include "bvh.h" |
4109 | 4072 | #include "camera.h" |
4110 | 4073 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight |
|
0 commit comments