The problem is that when we drag the shape with the right mouse button, the center of the camera stays in place.
How do you make the center of rotation move with the shapes?
You would have to add drag behavior, like in this example: Babylon.js Playground Then you could add something in the pointer up/down events to look at the current mesh while the pointer is held down.
There’s also the class PointerDragBehavior that has some camera control stuff you can specify. You could check out some of the playground examples for that also.
This is exactly what Kvas says. Only your camera is moved, not your objects. My example works correctly, because this camera refocuses according to the position of your objects.
With my example, if you move the object, the camera will refocus on the object being moved.
@Igorg599 it might be helpful if you can point us to any other app that has the behavior you are speaking of. I find it hard to imagine both the camera and the object moving in sync as you describe. I tend to want one or the other but not both at the same time. Take this example using ArcRotateCamera: https://www.babylonjs-playground.com/#Z9VF08
I can move the object with the gizmo while camera is stationery, or I can move the camera using the zoom wheel or left mouse drag. Now imagine if while moving the object the camera also chases that movement, then my relative mouse positions would also move and the object would shoot off screen in a big weird chase. So I’m wondering what you have in mind exactly?