I’m trying to make panning in Babylon a bit better, the way I know it from Cinema4D (I think) is pretty good:
As you can see, while panning the camera, the object you’re panning it against always stays under your mouse cursor. This gives you very precise control over your operation.
In Babylon on the other hand your manipulation is not directly connected to your cursor. Your cursor movement basically defines a distance which is multiplied with a speed factor to move your camera.
The question is: If I want to implement a panning system like in Cinema4D, does anyone have ideas about how to realize this?
Another way to do it, simply using pickedPoint’s (assuming a ‘ground’ mesh is always behind the cursor), also disabled y-axis, https://playground.babylonjs.com/#GD4NPB#2
Does not seem to work as good as @Gijs solution, when picking a point on the cube the point does not always end up under my cursor (it looks like it’s always picking the ground plane?)
Correct, as i wrote and the picking predicate indicates ( (m) =>{ return m.name === ‘ground’} )
It pans according to a pick on the ground mesh
It’s a simple solution, @Gijs solution is the way to go, if you must be able to click anywhere and have the cursor stay at the ~exact same spot of any mesh.