Rotation of the model seems restricted along horizontal axis when using ArcRotateCamera

Hi,

I have a basic question on the rotation of the loaded model when using ArcRotateCamera.

What I see is that the loaded model freely moves 360 degrees along the vertical axis (select model and move mouse left or right) but the movement along horizontal axis is not 360 degrees (select model and move mouse up or down).

I have a very basic example in the playground: https://www.babylonjs-playground.com/#E6HLMF#1

Is it possible to make the model rotate 360 degrees also along the horizontal axis?

Regards,
Nithin

Hello,

ArcRotateCamera have params for limiting radius (distance), alpha (horizontal), and beta (vertical) angles.

camera.lowerAlphaLimit
camera.lowerBetaLimit
camera.lowerRadiusLimit
camera.upperAlphaLimit
camera.upperBetaLimit
camera.upperRadiusLimit

In your case what you want is

camera.lowerAlphaLimit = 0;
camera.upperAlphaLimit = 2*Math.PI;

Playground

++
Tricotou

3 Likes

Hi @Tricotou ,

Thank you so much for this insight.

I saw that the alpha values were ok and it was the beta values that was restricted. So, did the following and now it works as expected.

camera.lowerBetaLimit = camera.lowerAlphaLimit;
camera.upperBetaLimit = camera.upperAlphaLimit;

Thanks again :smiley:

Regards,
Nithin

1 Like