aboutsummaryrefslogtreecommitdiffstats
path: root/include/camera.hpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2020-12-20 22:42:37 +0100
committerladevieq <ladevie.quentin@gmail.com>2020-12-20 22:42:37 +0100
commit643708a9922cabe9b37329ee41a8668087dc92d7 (patch)
treee4052ae5b08569d97af39afc8456852d836d6c9f /include/camera.hpp
parent44c1eec63fc51d1a4eb888cde5e8f4b874876bab (diff)
Add a camera class
Diffstat (limited to 'include/camera.hpp')
-rw-r--r--include/camera.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/camera.hpp b/include/camera.hpp
new file mode 100644
index 0000000..82f7155
--- /dev/null
+++ b/include/camera.hpp
@@ -0,0 +1,21 @@
+#ifndef __CAMERA_HPP_
+#define __CAMERA_HPP_
+
+#include "rt.hpp"
+
+class camera {
+ public:
+ camera(point3 position, double aspect_ratio, double focal_length);
+
+ ray get_ray(double u, double v) const;
+
+ point3 position;
+ double focal_length;
+
+ vec3 horizontal;
+ vec3 vertical;
+
+ point3 bottom_left_pixel;
+};
+
+#endif // !__CAMERA_HPP_