Can't seem to find the solution to my following problem. I have a perspective cam set up in libGDX. I use the .rotateAround routine to rotate my camera. This works perfectly when rotating around low coords. But the higher the coordines of the axis to rotate around, the more jerky the rotation is becoming.
In my CameraInputController Class:
@Override
protected boolean process(float deltaX, float deltaY, int button) {
if (button == Buttons.LEFT) {
// DRAG CAMERA
} else if (button == Buttons.RIGHT) {
// ROTATE CAMERA
perspectiveCam.rotateAround(new Vector3(clickedX, clickedY, 0), Vector3.Z, deltaX * -100);
}
return true;
}
This works:
perspectiveCam.rotateAround(new Vector3(0f, 0f, 0f), Vector3.Z, deltaX * -100)
The following code results in small portions dragging, followed by a sudden rotation, then dragging again, etc:
perspectiveCam.rotateAround(new Vector3(100000f, 100000f, 0f), Vector3.Z, deltaX * -100)
I know it works by translating, then rotating the cam, and then translating the camera back. Can anyone point me in the right direction? Is it something in the radius/float value?
Thanks in advance!
EDIT: See here for the 'bug': rotating gif