What are cameras in Babylon.js, and how are they used?

In Babylon.js, cameras are essential components that define the viewpoint and perspective from which the 3D scene is observed. Cameras determine how the scene is rendered and how objects within the scene are viewed on the screen. Babylon.js provides various types of cameras, each serving different purposes and offering specific functionalities. Here are some of the commonly used types of cameras in Babylon.js:

1. FreeCamera : A FreeCamera is a versatile camera that allows free movement in the 3D space. It is often used for general-purpose navigation and exploration within the scene.

Example of creating a FreeCamera :
var camera = new BABYLON.FreeCamera("camera", new BABYLON.Vector3(0, 5, -10), scene);?

2. ArcRotateCamera : An ArcRotateCamera is designed for orbiting around a target point (often the center of the scene). It provides a more controlled and user-friendly way to navigate around the scene.

Example of creating an ArcRotateCamera :
var camera = new BABYLON.ArcRotateCamera("camera", Math.PI / 2, Math.PI / 4, 10, BABYLON.Vector3.Zero(), scene);?

3. FollowCamera : A FollowCamera is specialized for following a specific target mesh. It automatically adjusts its position and rotation to keep the target in view, which is useful for scenarios like third-person perspectives.

Example of creating a FollowCamera :
var camera = new BABYLON.FollowCamera("camera", new BABYLON.Vector3(0, 10, -10), scene);
camera.lockedTarget = someMesh;?
4. UniversalCamera : The UniversalCamera is a flexible camera that combines elements of both FreeCamera and ArcRotateCamera. It provides options for both first-person and orbit-style controls.

Example of creating a UniversalCamera :
var camera = new BABYLON.UniversalCamera("camera", new BABYLON.Vector3(0, 5, -10), scene);?

5. OrthographicCamera : An OrthographicCamera is used for creating a 2D-like, orthographic projection. It is suitable for certain types of games or architectural visualizations where a perspective effect is not desired.

Example of creating an OrthographicCamera :
var camera = new BABYLON.FreeCamera("camera", new BABYLON.Vector3(0, 5, -10), scene);
camera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA;?

6. DeviceOrientationCamera and VRDeviceOrientationFreeCamera : These cameras are designed for virtual reality (VR) experiences and take advantage of device orientation sensors in VR headsets or mobile devices.

Example of creating a VRDeviceOrientationFreeCamera :

var camera = new BABYLON.VRDeviceOrientationFreeCamera("camera", new BABYLON.Vector3(0, 5, -10), scene);?

Once a camera is created, it needs to be attached to the scene using the scene.activeCamera property. For example:
scene.activeCamera = camera;?