I am a longtime reader of this forum but this is the first time I am leaving the observer modus. So hi and thank you so much for all these fantastic pointers over the years.
Currently I am building a new project with the fantastic Arcball Controls. It is a 2D map so I have panning enabled controls.enablePan = true; and Cursor Zoom controls.cursorZoom = true;.
Everything works perfectly. But when I am updating the camera position with gsap the entire scene rotates. Logging console.log(camera.rotation) shows me that there is an actual rotation going on.
I have made a minimal version of the problem here:
Conceptually I kind of understand the problem. But I cannot wrap my head around what I need to update in addition to the rotation. What I what is the same animation behavior as on Zoom interaction from Cursor Zoom and Pan.
Any help would be highly appreciated. The project also works without the animated zooming, but with it, it would be much cooler.
The ArcballControls has a property called target. It defines the where the camera is facing. If you pan the camera, you should also pan the target. I guess this picture shows the situation:
This works perfectly, thank you so much. I wouldn’t have come up with this solution on my own but in hindsight, it makes complete sense. Also thank you for this detailed answer and the diagram. I am utterly happy that this is working.