How to simulating focal length in OpenGL ?

Dear All:
My application need me to simulate a virtual camera in OpenGL.
How to simulate or compute the focal length based on glulookat and gluperspective?
In computer vision, if a 3d point locate at (X,Y,Z) (in camera coordinate system),
then this point should be project to the image pixel (u,v)=(fX/Z,fY/Z).
How to simulate this? I mean if the camera position ,direction and focal f are given, how to calculate the fovy and znear?

Websearch “depth of field” techniques. Possibly in combination with “OpenGL”. Also search “bokeh” possibly in combination with “pettineo”. Lots of good stuff out there. The basic concept is that you have a depth that is perfectly in-focus but as you get further from the plane, you get more and more out-of-focus. Blur is often used to simulate the out-of-focus effect.