Been fiddling with this all day. Confused, but maybe there’s a reason?
When I change Alpha & Beta of my ArcRotateCamera, Radius also changes… even though I don’t change Radius.
For example, this code:
var camera = new BABYLON.ArcRotateCamera("ArcRotateCamera", 0, 2, 3.14, BABYLON.Vector3.Zero(), scene);
camera.setPosition(new BABYLON.Vector3(1, 2, 3.14));
camera.setPosition(new BABYLON.Vector3(2, 2, 3.14));
camera.setPosition(new BABYLON.Vector3(5, 2, 3.14));
Will also change the radius to the something approximating the alpha value. Is this expected behavior? Or am I misunderstanding how setPosition works?
Screenshots show opening state, followed by the set position commands.
Your camera has a target and you ask it to move to a specific position. So the radius and alpha, beta values will change as the target will remain the same
I probably need to study up on my circle math, but I’d assume that radius would stay the same as alpha/beta change. Distance to target remains constant as the camera rotates around the circumference as defined by the radius?
For a visual, i’m looking at this graph from the help files…
Just to clarify here, setPosition sets the camera x, y and z position.
It’s setPosition(x,y,z) not setPosition(alpha, beta, radius) which I think is what you were expecting.
As @Deltakosh said, the camera has a target that is held constant when setPosition is called, so alpha beta and radius may all change. For example if the current target is (0,0,0) and the current position is (0,1,0) (so looking straight down if y up), alpha and beta will be 0, and radius will be 1. Calling setPosition(0,2,0) will not change the alpha or beta, but radius will now be 2.