Hi everyone !
I have been trying to implement zoom in to mouse position by wheel .
I tried to override the zoom wheel handler in the source code but couldnt get the current mouse position.
Is there a way to do it? Or maybe someone have a better way?
This is something we wanted to have the option for doing eventually, but it shouldn’t be hard to implement. You can listen to mouse move and save the last position. When the mouse wheel turns you can call CameraController.getPickRay with the saved mouse position. Then call CameraController.move with the direction returned by getPickRay and an amount in meters determined by the how much the mouse wheel turned. This will only work when the camera is in world space.
I hope that helps. Let me know if you need any more detailed information.
Regards,
Dan
Hi there - did you ever get this working? I am planning to attempt the exact same task, but thought I would check if you’d gotten it done or if it’s on the list of enhancements in the short term.
Thanks for your very helpful notes Daniel, it does look doable, will share if I get it working.