4. Install the Logger

Add the Metalitix Logger to your A-Frame experience

  1. Add the Metalitix Logger to your experience using HTML or NPM.

Run the below command if you have npm installed.

npm install @metalitix/metalitix-aframe
  1. Run the Metalitix Logger in your experience by using the Metalitix A-Frame component or executing the Javascript class.

Add a metalitix-logger attribute to your AFrame scene (a-scene). The attribute accepts apiKey and sceneId parameters. You will find the apiKey within your project settings in the Metalitix dashboard while the sceneId is the 3D model of the experience (an a-entity or Object3D).

<a-scene
     id="aframe-scene"
     metalitix-logger="
          apiKey: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;
          sceneId: my-scene-model;
">
     <a-camera id="my-camera"></a-camera>
     <a-entity id="my-scene-model">
          <!-- This is the scene model or the parent for the scene's models. -->
     </a-entity>
     ...
</a-scene>

If the active camera changes in the A-Frame scene, the logger will automatically account for this.

The camera and your scene object should not be parents or children of each other.

Metalitix will record camera movement relative to your scene object's transformations. So, it is not necessary to manually calibrate the scene in the Metalitix dashboard. If you do not pass a scene object, then recorded camera movement will be in world coordinates and manual calibration may be necessary.

Last updated