First, thanks for this code, I've been using it for a project, since it is well documented with the videos and it actually helped me to understand Ray Tracing.
I think there is a little bug in the getColorAt function, but I would like to discuss it with your first.
In line 216 you are normalizing the vector, and then you are getting the distance to the light by using the magnitude of the vector, which will always be 1. I think the .normalize() should be removed.
I will let you know if I find any other details. Please let me know if I can help you somehow!
Thanks!
Jose Monsalve
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi caleb,
First, thanks for this code, I've been using it for a project, since it is well documented with the videos and it actually helped me to understand Ray Tracing.
I think there is a little bug in the getColorAt function, but I would like to discuss it with your first.
In line 216 you are normalizing the vector, and then you are getting the distance to the light by using the magnitude of the vector, which will always be 1. I think the .normalize() should be removed.
I will let you know if I find any other details. Please let me know if I can help you somehow!
Thanks!
Jose Monsalve
I found another thing, in line 234, the break command, I thing you were trying to add that break inside the if statement. line 231.