Refactor projection matrix handling.