Skip to content

Commit

Permalink
[#4] Fix the rotation bug due to incorrect front face setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Morozov-5F committed Nov 28, 2021
1 parent 92cec70 commit fd3052e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hittables/rt_instance.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fd3052e

Please sign in to comment.