Switched the order of rotation for the old setup around, so as to fit the description of panning the camera in FPS mode. The code is in the comments, by the way.