This repository has been archived on 2024-12-30. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2024CG-project-render/include/viewing_ray.h
github-classroom[bot] 6eef377959
Initial commit
2024-10-11 10:27:35 +00:00

26 lines
666 B
C

#ifndef VIEWING_RAY_H
#define VIEWING_RAY_H
#include "Ray.h"
#include "Camera.h"
// Construct a viewing ray given a camera and subscripts to a pixel
//
// Inputs:
// camera Perspective camera object
// i pixel row index
// j pixel column index
// width number of pixels width of image
// height number of pixels height of image
// Outputs:
// ray viewing ray starting at camera shooting through pixel. When t=1, then
// ray.origin + t*ray.direction should land exactly on the center of the
// pixel (i,j)
void viewing_ray(
const Camera & camera,
const int i,
const int j,
const int width,
const int height,
Ray & ray);
#endif