How to set zooming based on the position of cursor in mouse-wheel?

This is now in the latest version of Babylonjs, see https://playground.babylonjs.com/#GT8E7R#1 for an example.


Updated Babylon to version 5.0.0-alpha.15.
But the method “zoomToMouseLocation” doesn’t work. :sleepy:

You’ll need to use “latest” version:
image

Thank! Happened!
But what if the objects are not located at the center of the coordinate system?
The camera begins to behave inappropriately.

can you provide a playground example of the problem you describe?

https://playground.babylonjs.com/#Q8VH3H#7

box.position = new BABYLON.Vector3(-10, -50, 0);
sphere.position = new BABYLON.Vector3(0, -40, 0);
plane.position.z = 10;
plane.position.y = -50;
cylinder.position.z = -10;
cylinder.position.y = -50;
cylinder.position.y = -50;
torus.position.x = 10;
torus.position.y = -50;
knot.position.y = -60;

Imagine that we have moved all the elements below.
I want the camera to be at the bottom now too. And everything worked the same way as in the center of the coordinate system.

Try this version: https://playground.babylonjs.com/#Q8VH3H#11