I’m currently using this code:
There seems to be a bug in the code, but I cannot locate it. You can replicate the bug by holding the mouse button down in the window and moving the mouse up and down rapidly. What should happen is the view shakes, but the overall orientation stays the same. What actually happens is the camera slowly rolls and pans to the right.
I’ve commented out the code responsible for panning (rotating around the up vector), thereby only allowing for up and down camera movements and it is definitely in the portion of code that rotates the camera along the x axis.
There is something very wrong here, but I am at a loss as to what. I tried the DirectX version of the same code and this problem does not show up. I don’t know if this is a driver issue (doubtful), a bug in GL (VERY doubtful) or a problem with some part of this code. If it is a bug in the code, and it really only can be, I cannot find it.
I really need to implement this in my game engine and I know it can be done in GL. Just cannot seem to get it to work…