Skip to content

Commit 80814ab

Browse files
move sign
1 parent 23adeb0 commit 80814ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/testrender/raytracer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,15 @@ struct Scene {
284284
{
285285
float cosx = dot(p.dx().normalized(), N);
286286
float cosy = dot(p.dy().normalized(), N);
287-
float cosI = dot(I.normalized(), N);
287+
float cosI = dot(-I.normalized(), N);
288288

289289
if (abs(cosI)>1e-3 )
290290
{
291291
float deltaX = p.dx().length() * cosx / cosI;
292292
float deltaY = p.dy().length() * cosy / cosI;
293293

294-
p.dx() -= I.normalized() * deltaX;
295-
p.dy() -= I.normalized() * deltaY;
294+
p.dx() += I.normalized() * deltaX;
295+
p.dy() += I.normalized() * deltaY;
296296
}
297297
}
298298

0 commit comments

Comments
 (0)