World Tracking & Image Targets
If you want World Tracking or Image Targets, add the xrweb component to your a-scene:
<a-scene xrconfig xrweb>
xrweb Attributes (all optional)
| Component | Type | Default | Description |
|---|---|---|---|
| scale | String | 'responsive' | Either 'responsive' or 'absolute'. 'responsive' will return values so that the camera on frame 1 is at the origin defined via XR8.XrController.updateCameraProjectionMatrix(). 'absolute' will return the camera, image targets, etc in meters. The default is 'responsive'. When using 'absolute' the x-position, z-position, and rotation of the starting pose will respect the parameters set in XR8.XrController.updateCameraProjectionMatrix() once scale has been estimated. The y-position will depend on the camera's physical height from the ground plane. |
| disableWorldTracking | Boolean | false | If true, turn off SLAM tracking for efficiency. |
Notes:
xrwebandxrfacecannot be used at the same time.xrwebandxrlayerscan be used at the same time. You must usexrconfigwhen doing so.- Best practice is to always use
xrconfig; however, if you usexrwebwithoutxrfaceorxrlayersorxrconfig, thenxrconfigwill be added automatically. When that happens all attributes which were set onxrwebwill be passed along toxrconfig.
- Best practice is to always use
cameraDirection: World tracking (SLAM) is only supported on thebackcamera. If you are using thefrontcamera, you must disable world tracking by settingdisableWorldTracking: true.- World tracking (SLAM) is only supported on mobile devices.
xrwebComponent()
XR8.AFrame.xrwebComponent()
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('xrweb', XR8.AFrame.xrwebComponent())