When you say that they exit the camera, do you mean that they are from the side, because you are looking at a fixed distance? .. or do you mean that they simply disappear.
If this is the first case (from the side of the picture), you should be able to calculate how far from the x, y plane you need to move the camera based on the current perspective settings.
, , , Z, .
[ 1] gluPerspective . , . , , - , , , .
[ 2] , .