Skip to content

Commit

Permalink
Improve default camera configuration #18
Browse files Browse the repository at this point in the history
  • Loading branch information
smercer10 committed Feb 27, 2024
1 parent 37e23ea commit d110b8d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions include/raydiance/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,21 @@ class camera {
int imgHeight{};
int samplesPerPixel{10};
int maxDepth{10}; // Maximum number of bounces for a ray
double fieldOfView{90.0};// Vertical field of view in degrees
point3 lookFrom{0, 0, -10};
point3 lookAt{0, 0, 0};
vec3 cameraUp{0, 1, 0}; // Up direction of the camera
double defocusAngle{0.0}; // Variation angle of rays through each pixel
double focusDistance{10.0};// Distance from lookFrom to the focal plane
double fieldOfView{45.0};// Vertical field of view in degrees
point3 lookFrom{0.0, 0.0, 0.0};
point3 lookAt{0.0, 0.0, 1.0};
vec3 cameraUp{0.0, 1.0, 0.0};// Up direction of the camera
double defocusAngle{0.0}; // Variation angle of rays through each pixel
double focusDistance{1.0}; // Distance from lookFrom to the focal plane

// Initialize data members
void initialize();

// Get a randomly sampled ray for the pixel at (x, y)
[[nodiscard]] ray getRay(int x, int y) const;

// Gets the colour of the object that the ray intersects
// If the ray doesn't intersect anything, returns the background colour
static colour getRayColour(const ray &r, int depth, const object &world);

// Get a vector from the centre of a pixel to a random point near the centre
Expand Down

0 comments on commit d110b8d

Please sign in to comment.