Skip to content

Commit f015eef

Browse files
committed
This fixes issue #135. Not sure when the bug was introduced though.
1 parent a556340 commit f015eef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/shapes/triangle.rs

+3
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ impl Triangle {
335335
// override surface normal in _isect_ for triangle
336336
let mut surface_normal: Normal3f =
337337
Normal3f::from(vec3_cross_vec3(&dp02, &dp12).normalize());
338+
if self.mesh.reverse_orientation ^ self.mesh.transform_swaps_handedness {
339+
surface_normal = -surface_normal;
340+
}
338341
let mut shading: Shading = Shading {
339342
n: surface_normal,
340343
dpdu,

0 commit comments

Comments
 (0)