faire la norme

This commit is contained in:
H3XploR
2025-02-17 23:52:47 +01:00
parent 960a2ad8ae
commit c6c13573cb
20 changed files with 539 additions and 440 deletions
+1 -2
View File
@@ -29,7 +29,7 @@ t_scene parsing_sphere(t_scene scene)
float intersectSphere(t_ray ray, t_sphere s, t_vec3 *hitNormal)
{
t_calc calc;
calc.oc = vec3_sub(ray.origin, s.center);
calc.a = vec3_dot(ray.dir, ray.dir);
calc.b = 2.0f * vec3_dot(calc.oc, ray.dir);
@@ -47,4 +47,3 @@ float intersectSphere(t_ray ray, t_sphere s, t_vec3 *hitNormal)
*hitNormal = vec3_normalize(vec3_sub(calc.hitPoint, s.center));
return (calc.t);
}