2023-02-19 20:55:42 +01:00
|
|
|
#pragma once
|
|
|
|
|
2023-02-19 22:30:48 +01:00
|
|
|
#include "math.h"
|
|
|
|
#include "vec3.h"
|
|
|
|
#include "ray.h"
|
2023-02-19 20:55:42 +01:00
|
|
|
#include "image.h"
|
|
|
|
|
|
|
|
class camera
|
|
|
|
{
|
2023-02-19 22:30:48 +01:00
|
|
|
public:
|
|
|
|
camera(
|
|
|
|
point3 lookfrom,
|
|
|
|
point3 lookat,
|
|
|
|
vec3 vup,
|
|
|
|
double vfov, // vertical field of view in degrees
|
|
|
|
double aspect_ratio,
|
|
|
|
double aperture,
|
|
|
|
double focus_dist);
|
|
|
|
|
|
|
|
ray get_ray(double s, double t) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
point3 origin_;
|
|
|
|
point3 lower_left_corner_;
|
|
|
|
vec3 horizontal_;
|
|
|
|
vec3 vertical_;
|
|
|
|
vec3 u_, v_, w_;
|
|
|
|
double lens_radius_;
|
2023-02-19 20:55:42 +01:00
|
|
|
};
|