aboutsummaryrefslogtreecommitdiffstats
path: root/src/ray.cpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2020-12-20 14:49:20 +0100
committerladevieq <ladevie.quentin@gmail.com>2020-12-20 14:49:20 +0100
commit3935a609141623e7cfb3fa339da1a166e3917018 (patch)
treeba8d6275b1f9947af92f9c887608f71f73e6609d /src/ray.cpp
parent2d8e108dd6811bcf55bed28f1855a36077f8c674 (diff)
Ray tracer renderer
Use ray for rendering Setup basic rendering stuff camera / viewport
Diffstat (limited to 'src/ray.cpp')
-rw-r--r--src/ray.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ray.cpp b/src/ray.cpp
new file mode 100644
index 0000000..2d479b7
--- /dev/null
+++ b/src/ray.cpp
@@ -0,0 +1,8 @@
+#include "ray.hpp"
+
+ray::ray(const point3& origin, const vec3& direction): origin(origin), direction(direction)
+{}
+
+point3 ray::at(double t) {
+ return origin + direction * t;
+}