Skip to main content

Camera Configuration

To configure the camera feed, add the xrconfig component to your a-scene:

<a-scene xrconfig>

xrconfig Attributes (all optional)

ComponentTypeDefaultDescription
cameraDirectionString'back'Desired camera to use. Choose from: back or front. Use cameraDirection: front; with mirroredDisplay: true; for selfie mode. Note that world tracking is only supported with cameraDirection: back;.`
allowedDevicesString'mobile-and-headsets'Supported device classes. Choose from: 'mobile-and-headsets' , 'mobile' or 'any'. Use 'any' to enable laptop or desktop-type devices with built-in or attached webcams. Note that world tracking is only supported on 'mobile-and-headsets' or mobile.
mirroredDisplayBooleanfalseIf true, flip left and right in the output geometry and reverse the direction of the camera feed. Use 'mirroredDisplay: true;' with 'cameraDirection: front;' for selfie mode. Should not be enabled if World Tracking (SLAM) is enabled.
disableXrTabletBooleanfalseDisable the tablet visible in immersive sessions.
xrTabletStartsMinimizedBooleanfalseThe tablet will start minimized.
disableDefaultEnvironmentBooleanfalseDisable the default "void space" background.
disableDesktopCameraControlsBooleanfalseDisable WASD and mouse look for camera.
disableDesktopTouchEmulationBooleanfalseDisable desktop fake touches.
disableXrTouchEmulationBooleanfalseDon’t emit touch events based on controller raycasts with the scene.
disableCameraReparentingBooleanfalseDisable camera -> controller object move
defaultEnvironmentFloorScaleNumber1Shrink or grow the floor texture.
defaultEnvironmentFloorTextureAssetSpecify an alternative texture asset or URL for the tiled floor.
defaultEnvironmentFloorColorHex Color#1A1C2ASet the floor color.
defaultEnvironmentFogIntensityNumber1Increase or decrease fog density.
defaultEnvironmentSkyTopColorHex Color#BDC0D6Set the color of the sky directly above the user.
defaultEnvironmentSkyBottomColorHex Color#1A1C2ASet the color of the sky at the horizon.
defaultEnvironmentSkyGradientStrengthNumber1Control how sharply the sky gradient transitions.

Notes:

  • cameraDirection: When using xrweb to provide world tracking (SLAM), only the back camera is supported. If you are using the front camera, you must disable world tracking by setting disableWorldTracking: true on xrweb.

xrconfigComponent()

XR8.AFrame.xrconfigComponent()

Creates an A-Frame component which can be registered with AFRAME.registerComponent(). This, however, generally won't need to be called directly. On 8th Wall Web script load, this component will be registered automatically if it is detected that A-Frame has loaded (i.e if window.AFRAME exists).

window.AFRAME.registerComponent('xrconfig', XR8.AFrame.xrconfigComponent())