Hi everyone,
I’m trying to implement a camera zoom that focuses on a specific point in the scene, while keeping the camera’s target as close to the center of the viewport as possible. The behavior I’m aiming for is somewhat similar to zoomToMouseLocation
, but the point I’m zooming to is static.
My current approach is to compute the change in camera radius and add a fraction of the direction vector from the target to the static point. However, I’m encountering issues where the zooming behavior becomes glitchy, particularly with inconsistent zoom speed.
You can see my current attempt in this Playground: Babylon Playground.
The point I’m zooming to is in the top-left corner, but the zoom speed is uneven and it causes some glitches. Any insights or suggestions on how to improve this?
Thanks in advance!