I am working on some sort of city builder where you can drag the camera with your mouse. It all works fine accept when you turn the camera.
Mouse drag script:
private float angleArroundTarget = 0; // rotation arround the target \\
// draggable camera \\
if(Mouse.isButtonDown(0)){
targetPosition.x += delta * (Mouse.getDX() * 2);
targetPosition.z -= delta * (Mouse.getDY() * 2);
}
If you know a calculation where it does not depend on the angleArroundTarget when you drag the camera arround please let me know.
Thanks in advance