Add a super special Camera from a well known constructor. Can take picture up to Infinite TeraPixel!

This commit is contained in:
Godzil
2020-02-20 16:08:47 +00:00
parent ba1ae34855
commit a477b137e7
5 changed files with 314 additions and 2 deletions

38
source/include/camera.h Normal file
View File

@@ -0,0 +1,38 @@
/*
* DoRayMe - a quick and dirty Raytracer
* Camera header
*
* Created by Manoël Trapier
* Copyright (c) 2020 986-Studio.
*
*/
#ifndef DORAYME_CAMERA_H
#define DORAYME_CAMERA_H
#include <matrix.h>
#include <stdint.h>
#include <ray.h>
#include <canvas.h>
#include <world.h>
class Camera
{
private:
double halfWidth;
double halfHeight;
public:
uint32_t verticalSize;
uint32_t horizontalSize;
double fieldOfView;
double pixelSize;
Matrix transformMatrix;
Matrix inverseTransform;
public:
Camera(uint32_t hsize, uint32_t vsize, double fov);
void setTransform(Matrix transform);
Ray rayForPixel(uint32_t pixelX, uint32_t pixelY);
Canvas render(World w);
};
#endif /* DORAYME_CAMERA_H */