Computer Graphics, Python, Mathematics, Game Development, Game Design.
and t2 are positive. This is because a t that solves the equation could be negative, but it would mean that the ray that intersects the sphere doesn’t have d as a direction vector, but -d (for instance if the sphere is behind the camera and the screen). Nearest intersected object All right, so far