Sphere normal indentation fixed.
This commit is contained in:
parent
6674549b18
commit
e168bb7b77
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue