Camera
The Arcrotate camera can be controlled via the API. The camera can be moved, rotated and zoomed. You can set the target, alpha, beta, radius and fov of the camera.
camera.target
Set the target of the camera. The target is the point the camera is looking at. If no argument is provided, the current target will be returned.
GET | SETcamera.target(position?: [x: number, y: number, z: number]): Promise<[x: number, y: number, z: number]>
api.camera.target([0, 0, 0])
actions: [{ name: 'camera.target', arg: [0, 0, 0] }]
camera.alpha
Set the alpha (rotation around the y-axis) of the camera. In radians. If no argument is provided, the current alpha will be returned.
GET | SETcamera.alpha(alpha?: number): Promise<number>
api.camera.alpha(Math.PI / 4)
actions: [{ name: 'camera.alpha', arg: 1 }]
camera.beta
Set the beta (angle from the horizon) of the camera. In radians. If the beta is set to 0, the camera is looking straight down. If the beta is set to PI, the camera is looking straight up. If no argument is provided, the current beta will be returned.
GET | SETcamera.beta(alpha?: number): Promise<number>
api.camera.beta(Math.PI / 4)
actions: [{ name: 'camera.beta', arg: 1 }]
camera.rotations
Set the alpha and beta of the camera. In radians. If no argument is provided, the current alpha and beta will be returned.
GET | SETcamera.rotations(alpha: number, beta: number): Promise<[alpha: number, beta: number]>
api.camera.rotations([Math.PI / 4, Math.PI / 4]).then((result) => console.log(result))
// [0.7853981633974483, 0.7853981633974483]
actions: [{ name: 'camera.rotations', arg: [0.75, 0.75] }]
camera.radius
Set the radius (distance from the target) of the camera. In meters. If no argument is provided, the current radius will be returned.
GET | SETcamera.radius(radius?: number): Promise<number>
api.camera.radius(5)
actions: [{ name: 'camera.radius', arg: 5 }]
camera.fov
Get or Set the field of view of the camera in radians. If no argument is provided, the current fov will be returned.
GET | SETcamera.fov(fov?: number): Promise<number>
api.camera.fov(Math.PI / 2)
actions: [{ name: 'camera.fov', arg: 1 }]