dilevin / computer-graphics-ray-tracing

Computer Graphics Assignment about Ray Tracing
1 stars 5 forks source link

inside-a-sphere expected output #62

Open MstrPikachu opened 1 year ago

MstrPikachu commented 1 year ago

I tried running inside-a-sphere and I have shadows but I don't know if they're exactly as expected. I did draw a diagram on paper but it's hard to accurately get down the proportions of the shadows to scale.

I made a copy of inside-a-sphere where the camera width x height is 3x3 so I could see more and got this. Interestingly enough part of the camera goes outside of the planes, which is funny.

Could anyone tell me if I'm on the right track? The sphere shadows look more correct with the additional context compared to the cropped image. Before it just looked like one big shadow.

image

Kenny2github commented 1 year ago

Sphere z-coordinate: 1.6 Sphere radius: 0.5 Camera z-coordinate: 5 Camera focal length: 3 Focial plane z-coordinate: 5 - 3 = 2 Closest point on sphere to camera z-coordinate: 1.6 + 0.5 = 2.1 > 2 Conclusion: The black circle in the middle is where the sphere intersects the focal plane.