From e168bb7b77b74743cf20c8935b8b34550ce77313 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 17 Nov 2022 17:34:17 +0100 Subject: [PATCH] Sphere normal indentation fixed. --- primitive/sphere.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/primitive/sphere.cpp b/primitive/sphere.cpp index 0029a7b..1da5c09 100644 --- a/primitive/sphere.cpp +++ b/primitive/sphere.cpp @@ -36,9 +36,9 @@ bool Sphere::intersect(Ray &ray) const { return false; // Calculate the normal - auto intersectPoint = ray.origin + ray.direction * t; - auto normalDirection = intersectPoint - this->center; // Point of intersect - origin of sphere creates a line along the normal, pointing outwards - ray.normal = normalized(normalDirection); + auto intersectPoint = ray.origin + ray.direction * t; + auto normalDirection = intersectPoint - this->center; // Point of intersect - origin of sphere creates a line along the normal, pointing outwards + ray.normal = normalized(normalDirection); // Calculate the surface position and tangent vector float const phi = std::acos(ray.normal.y);