From 324b226f9852911f012624da0218e97de86e8502 Mon Sep 17 00:00:00 2001 From: vonhyou Date: Mon, 19 Feb 2024 17:31:32 -0500 Subject: [PATCH] remove debug code --- src/RayTracer.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/RayTracer.cc b/src/RayTracer.cc index 5e61b0f..ce579d5 100644 --- a/src/RayTracer.cc +++ b/src/RayTracer.cc @@ -2,7 +2,8 @@ #include "../external/simpleppm.h" #include "Parser.h" #include "Ray.h" -#include + +#include #include void RayTracer::parse() { @@ -18,12 +19,11 @@ void RayTracer::parse() { Ray getRay(int x, int y, const Vector3f &camPos, const Vector3f &lookat, float fov, int width, int height) { - // TODO: compute ray float focalLength = lookat.norm(); float theta = fov / 180 * 3.14159; float h = tan(theta / 2); float viewportHeight = 2 * h * focalLength; - float viewportWidth = viewportHeight * width / height; + float viewportWidth = viewportHeight * (float)width / height; Vector3f viewportU = Vector3f(viewportWidth, 0, 0); Vector3f viewportV = Vector3f(0, -viewportHeight, 0);