ArcRotateCamera panning issue when camera.panningAxis.y is set to zero and camera.beta is zero

Hi!

I did some research on this issue and I found some topics.

However I still don’t understand why the camera stops panning on the X axis when camera.beta === 0. I disabled panning only on the Y axis: camera.panningAxis = new BABYLON.Vector3(1, 0, 1) so X panning should work regardless the beta angle.

If camera.beta !== 0 the camera starts panning on the X axis.

Shouldn’t this be considered as a bug?

Thanks!

1 Like

I solved the issue by setting camera.mapPanning = true.
There is no need to change panningAxis.

I’m keeping the report open until someone from the team responds, in case it’s a legitimate issue.

cc @amoebachant to have a look

1 Like

The panningAxis is in the camera’s space, so in your original playground, if you had set the panningAxis to BABYLON.Vector3(1, 1, 0) instead of BABYLON.Vector3(1, 0, 1) you would have been able to pan on the world X and Z axes like you wanted (and like mapPanning does).

Does that answer your question? Thanks!

2 Likes

Thank you! It works but I’m scratching my head :smiley:
Would you please explain why does this work?

Sure! Since the panningAxis is in camera space and not world space, if you want to be able to pan up/down and left/right as you look through the camera, you can set the panningAxis to 1, 1, 0 regardless of where it’s pointing.

In your playground, you have the camera positioned straight above the world space origin pointing straight down the Y axis, with world space Z pointing down. mapPanning forces the camera to only pan on the X and Z world space axes, so in this configuration, it’s the same behavior as setting the panningAxis of the camera to 1, 1, 0. If you change the camera to be at a different angle, you can see how the panningAxis and mapPanning options will give you different results.

Does that help?

2 Likes

Absolutely! Thanks a lot!

2 Likes