I'm following Peter Shirley book, Ray tracing in one weekend. In the last chapter, he talks about how to make defocus blur by using thin len approximation. His camera class accepts a parameter called focus_dist, which he then uses to compute the distance to the image plane.
lower_left_corner = origin - half_width*focus_dist*u -half_height*focus_dist*v - focus_dist*w; // lower_left_corner of image plane
This subject was new to me, so I went searching around online. From what i understand, the distance to the image plane is governed by the equation 1/f = 1/d + 1/d prime with f being focal length and d being the focus distance. d prime will be the answer. The lack of this equation in Peter Shirley's code and the fact that he seems to be putting the image plane at the focus distance makes me completely lost. Can anyone explain it to me?
Here's the link to the code I talked about. https://github.com/petershirley/raytracinginoneweekend/blob/master/camera.h