I have an ArcRotateCamera camera where I need accurate panning behavior.
I use panningSensibility and can pan; however, it is not accurate. How can I implement it accurately?
Is there any example to build a custom camera in Babylon from scratch?
From an implementation point of view, we like to convert the mouse screen point to an intersection point on the ground. From this logic, we like to calculate the difference between the ground’s start and endpoints. This is used to calculate the pan offset and apply it to the camera to perform the panning operation.
Hmm, doesn’t ‘camera.panningOriginTarget’ do the job?
When you say, it is not accurate, what do you mean exactly?
Is it the smoothness/speed? Or something else?
In the ArcRotateCamera, when I zoom closer and far to the ground plane, the panning does not seem to consider the zoom factor from the ground plane. Currently, we are using panningSensibility for this, but the result is not very accurate for a different level of zoom.
I am building a geographical map rendering application, and you can think of panning similar to how it works in any standard 3D map application. When the user clicks on the ground surface and applies the mouse move operation, it should apply the displacement accurately based on the move rate when the camera is near or far from the ground.
Yes, I understand (and I agree). This part is not perfect. I actually posted a comment recently from another similar topic when I detected the panning is not the same if you start your click on a scene object or on the ‘root’. Looks like the speed/sensibility is different (which might be what you want, only thing, it’s done in a weird manner that makes it, as you say, inaccurate). Hopefully this can be improved later on.