Panning limits different on x,y and z axis

Hello Masters’,

I am using an ArcRotateCamera and we have properties panningAxis and panningDistanceLimit.
setting panningDistance limit would set the same distance on all axis. how can i achieve… say 0.4 panning on x, 0.1 on y and not set anything on z.

Thank you

Camera man master @PolygonalSun :wink:

Hey @NHuq,
As of right now, there is no way to specify panning distance limits per axis. The only way that I could see to do it would be to implement your own version of the inputs for ArcRotateCamera’s pointer input ( Customizing Camera Inputs | Babylon.js Documentation (babylonjs.com)).

If you are just trying to keep your camera within a specific set of rotating bounds, you might be able to take advantage of lowerAlphaLimit/upperAlphaLimit and lowerBetaLimit/upperBetaLimit to create a desired restriction:

// Example
// Create an ArcRotateCamera and restrict its horizontal movement to [-PI/4, PI/4]
var camera = new BABYLON.ArcRotateCamera("camera", 0, Math.PI/2, 10, BABYLON.Vector3.Zero(), scene);
camera.lowerAlphaLimit = -Math.PI / 4;
camera.upperAlphaLimit = Math.PI / 4;

Thank you guys… the limit solution proposed on alpha and beta doesn’t really help my scene…i was looking to restrict panning on y axis, any ways thank you.

If you can create a playground of what you have so far, that will make it easier to help.