I am really struggling to understand the arc rotate camera because there is a critical gap in the documentation.
This PG demos the arc rotate camera and allows me to play around with it, but experimenting with the code has just left me more confused.
The problem is that the documentation has a nice picture to show the two axes of rotation, but crucially does not say how this relates to the x, y and z axes in the scene, and I can’t make any sense of it.
For example this PG creates an arc rotate camera like this:
var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 10, new BABYLON.Vector3(0, 0, 0), scene);
Which to me reads as the camera is pointing towards (0,0,0) and is a distance of 10 from this point. It has alpha and beta values of 0, but I have no idea where that places the camera in x, y, z space because it’s not documented.
The PG then goes on to
camera.setPosition(new BABYLON.Vector3(0, 0, -10));
which seems pointless to me since we already positioned the camera in the constructor, but commenting out this line changes the scene entirely. Does setPosition
do something different than passing the position to the constructor. Again this is not documented, maybe setPosition
is setting the x, y and z position of the camera, but if that’s the case then how can the camera stay 10 away from the target position?
Just a tiny shred of documentation would make a huge difference here. Is there anybody out there who knows how the arc rotate camera works and can supply the missing pieces. Thanks.