Interface: CameraSettings
Defines how the virtual camera behaves in the 3D scene.
The CameraSettings interface controls the "eye" through which users view the 3D scene, including its position, rotation, zoom limits, and behavioral properties. Camera settings significantly impact how users interact with and perceive products in the configurator.
Well-configured camera settings create an intuitive viewing experience that highlights product features while preventing disorienting perspectives or movements.
Example
// Creating a camera focused on a product with restricted movement
const productCamera = {
name: "MainProductView",
position: [0, 1.7, 3.5],
target: [0, 0.7, 0],
radius: 3.5,
alpha: Math.PI/4, // 45 degrees
beta: Math.PI/4, // 45 degrees
lowerRadiusLimit: 2, // Can't zoom closer than 2 units
upperRadiusLimit: 6, // Can't zoom farther than 6 units
lowerBetaLimit: 0.3, // Can't look too far down
upperBetaLimit: 1.5, // Can't look too far up
useAutoRotationBehavior: true
};
Properties
alpha
alpha:
number
Horizontal rotation angle in radians.
This controls the camera's position around the horizontal circle centered on the target (like longitude on a globe).
beta
beta:
number
Vertical rotation angle in radians.
This controls how high or low the camera is positioned relative to the target (like latitude on a globe).
collision?
optionalcollision:boolean
Defines whether the camera should check collision with the objects oh the scene.
collisionRadius?
optionalcollisionRadius:number[]
Defines the collision radius of the camera. This simulates a sphere around the camera.
disableCameraControls?
optionaldisableCameraControls:boolean
If true, camera controls are disabled.
When enabled, users cannot manually control the camera. The camera can only be positioned through code or predefined animations.