From ff9284e6b9bdbd8e4be9ce661eb668eb2b8b07f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Ji=C5=99i=C5=A1t=C4=9B?= Date: Wed, 27 Nov 2024 10:39:12 +0100 Subject: [PATCH] Fix issues with translation This was the same issue as was fixed in a2872aa. Ray was expected to have normalized direction, but did not. --- src/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.c b/src/main.c index 6f8eec6..68f1aa4 100644 --- a/src/main.c +++ b/src/main.c @@ -101,6 +101,7 @@ t_ray get_camera_ray(int x, int y, const t_session *s) vec_vec_mul(camera->orientation, camera->up_direction), (x_max - 1 - 2 * x) / (x_max - 1))), tan(camera->field_of_view / 2))); + res.direction = vec_real_mul(res.direction, 1 / vec_norm(res.direction)); return (res); } -- 2.30.2