From fd3052ea4a9378666f9472d9b49bc2d4831330ca Mon Sep 17 00:00:00 2001 From: Morozov-5F Date: Mon, 29 Nov 2021 00:52:15 +0300 Subject: [PATCH] [#4] Fix the rotation bug due to incorrect front face setting. --- hittables/rt_instance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hittables/rt_instance.c b/hittables/rt_instance.c index e814de7..ef566da 100644 --- a/hittables/rt_instance.c +++ b/hittables/rt_instance.c @@ -86,7 +86,7 @@ static bool rt_instance_hit(const rt_hittable_t *hittable, const ray_t *ray, dou vec3_add(&record->p, instance->offset); vec3_t new_normal = rt_mat3_mul_vec3(&instance->transform_matrix_bb, &record->normal); - rt_hit_record_set_front_face(record, &transformed_ray, &new_normal); + rt_hit_record_set_front_face(record, &ray, &new_normal); return true; }