From what I see, it's a simplification: rays start from (x, y, -10) and follow the z axis. This is very limited and I guess you'll lose the perspective.
Exercise for the reader: - Update the sample function, pass the ray direction as argument. - Compute the direction for each ray.
Rays should have a slightly different direction, based on the camera field of view. When you move the camera back or increase the field of view, the donut should get smaller.
Next exercise: move the camera around the donut (but still looking at it).