From fe9d42c7cb18bc1db6d278bdc2f8372822d025bf Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 21 May 2013 16:19:56 +0300 Subject: [PATCH] Transform normals correctly --- source/geometry/transformedshape.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/geometry/transformedshape.h b/source/geometry/transformedshape.h index 90c37b0..bf508f9 100644 --- a/source/geometry/transformedshape.h +++ b/source/geometry/transformedshape.h @@ -115,7 +115,7 @@ inline unsigned TransformedShape::get_intersections(const Ray &ray, points[i].position = transformation.transform(points[i].position); /* XXX This is not correct for nonuniform scaling. Inverse of the transpose of the upper DxD part of the matrix should be used. */ - points[i].normal = transformation.transform(points[i].normal); + points[i].normal = transformation.transform_linear(points[i].normal); points[i].distance = inner_product(points[i].position-ray.get_start(), ray.get_direction()); } } -- 2.45.2