I am closing this issue. The code was written for a camera in perspective mode, and doesn't work in orthogonal mode.