I wrote the light diffusing code and it's just not working I dont know why
this is the code I wrote for diffusing
t_vec pi = vec_add(ray.org,vec_times_double(ray.dir, t));
t_vec hp = vec_diff(light.pos, pi);
t_vec normal = get_sphers_normal(sp, pi);
double dot = vec_dot(normalize_vect(normal),normalize_vect(hp));
printf("hitpoint : %lf\n", dot);
put_pixel(mlx.img, x, y, rgb_to_int(sp.color)*double_abs(dot), resolution.width);