aboutsummaryrefslogtreecommitdiff
path: root/src/raytracer/raytracer.cpp
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-12-08 16:16:15 -0500
committersotech117 <michael_foiani@brown.edu>2023-12-08 16:16:19 -0500
commit713591fe7be4a96758f6a7ecfa810c925cf6c96c (patch)
treea9639561312b0f0fe10f3630b02994d6646a992d /src/raytracer/raytracer.cpp
parent87be193a27a4d6ab583982e6d22eaccf154fff34 (diff)
adjust pWorld and dWorld
Diffstat (limited to 'src/raytracer/raytracer.cpp')
-rw-r--r--src/raytracer/raytracer.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/raytracer/raytracer.cpp b/src/raytracer/raytracer.cpp
index 6b33150..2904e18 100644
--- a/src/raytracer/raytracer.cpp
+++ b/src/raytracer/raytracer.cpp
@@ -42,9 +42,8 @@ void RayTracer::render(RGBA *imageData, const RayTraceScene &scene) {
float z = (imageDepth - scene.height()/2.f) * viewplaneHeight / scene.height();
float camera4dDepth = 1;
- glm::vec4 pCamera =
- glm::vec4 pWorld = Vec4Ops::transformPoint4(camera.getvec4(x, y, z, camera4dDepth);
- glm::vec4 dWorld = glm::vec4(0.f, 0.f, -1.f, 0.f);
+ glm::vec4 pWorld = Vec4Ops::transformPoint4(glm::vec4(0.f), camera.getViewMatrix(), camera.getTranslationVector());
+ glm::vec4 dWorld = glm::vec4(0.f, 0.f, 0.f, -1.f);
// get the pixel color
glm::vec4 pixelColor = getPixelFromRay(pWorld, dWorld, scene, 0);