From 643708a9922cabe9b37329ee41a8668087dc92d7 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Sun, 20 Dec 2020 22:42:37 +0100 Subject: Add a camera class --- include/camera.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/camera.hpp (limited to 'include/camera.hpp') 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_ -- cgit v1.3