diff options
Diffstat (limited to 'apps/raytracing/1.cc.0')
-rw-r--r-- | apps/raytracing/1.cc.0 | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/apps/raytracing/1.cc.0 b/apps/raytracing/1.cc.0 deleted file mode 100644 index 13d5a1b6..00000000 --- a/apps/raytracing/1.cc.0 +++ /dev/null @@ -1,28 +0,0 @@ -// https://raytracing.github.io/books/RayTracingInOneWeekend.html -#include <iostream> - -int main() { - - // Image - - const int image_width = 256; - const int image_height = 256; - - // Render - - std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n"; - - for (int j = image_height-1; j >= 0; --j) { - for (int i = 0; i < image_width; ++i) { - auto r = double(i) / (image_width-1); - auto g = double(j) / (image_height-1); - auto b = 0.25; - - int ir = static_cast<int>(255.999 * r); - int ig = static_cast<int>(255.999 * g); - int ib = static_cast<int>(255.999 * b); - - std::cout << ir << ' ' << ig << ' ' << ib << '\n'; - } - } -} |