I have a perspective "lookAt-type" camera. I'm trying to compute specific focus point of the camera, which should be placed in the middle of the screen: I also have a custom 3d point in world space, margin values in screen space and camera's tilt as inputs. I want to compute lookAt point, & camera distance with restriction, that input world space point has to be visible in the middle of the free screen space area (not affected by margin values) and it has to have a given tilt.
I'm able to compute this in 2D, but I'm lost in 3D. Any idea how to achieve this? Here's a sketch of the problem, red and blue area's are margin values of 0.5f in both x and y direction.