T4 Use the Camera Class
Create camera.h
#ifndef CAMERA_H
#define CAMERA_H
#include "hittable.h"
class camera {
private:
/* Private Camera Variables Here */
void initialize() {
//...
}
color ray_color(const ray& r, const hittable& world) const {
//...
}
public:
/* Public Camera Parameters Here */
void render(const hittable& world) {
//...
}
};
#endifFilling the methods
ray_color()
intialise()
render()
Reduce main.cpp
Build and run the Program

Last updated