What determines the world space of tracking?

What determines if the camera is the center of the world, or if the object is at the center of the world? When I do an event: ‘reality.imageupdated’, the detail position is offset off 0,0,0. The when centering a 3dobject to the world origin, it appears at the center of the image target.The camera also does not move, which is different from when interacting with SLAM. But I have two projects using XR8.XrController.configure({ disableWorldTracking: true }) that do not have the same world space (one camera moves, one is stationary).This is some of the source code

XR8.addCameraPipelineModules([

 XR8.GlTextureRenderer.pipelineModule(), // Draws the camera feed.

 XR8.Threejs.pipelineModule(), // Syncs threejs renderer to camera properties.

 XR8.XrController.pipelineModule(),

 XRExtras.AlmostThere.pipelineModule(), // Detects unsupported browsers and gives hints.

 XRExtras.FullWindowCanvas.pipelineModule(), // Modifies the canvas to fill the window.

 XRExtras.Loading.pipelineModule(), // Manages the loading screen on startup.

 XRExtras.RuntimeError.pipelineModule(), // Shows an error image on runtime error.

 initScenePipelineModule(),

])

XR8.XrController.configure({ disableWorldTracking: true })

XR8.run({

 canvas: document.getElementById('camerafeed'),

 cameraConfig: {direction: XR8.XrConfig.camera().BACK},

 allowedDevices: XR8.XrConfig.device().MOBILE,

})

// Place a cube on the image tracked.

const updateTarget = ({detail}) => {

let q = new THREE.Quaternion(detail.rotation.x, detail.rotation.y, detail.rotation.z, detail.rotation.w )

  greenSquare.position.set(detail.position.x, detail.position.y, detail.position.z);

  greenSquare.quaternion.slerp(q, 0.75);

}

Testing the threeJS Flyer project from three.js: Image Targets Flyer | 8th Wall | 8th Wall
looks to show that the jellyfish model is positioned at 0,0,0
and it uses the code model.position.copy(detail.position)

detail.position contains the 3d position of the located image.

For example, when I add console logs to the showTarget function, I never seeing 0, 0, 0 logged. It is always a unique position, offset relative to the camera:

  const showTarget = ({detail}) => {

    if (detail.name === 'model-target') {
      console.log('model-target', detail.position)
    }

    if (detail.name === 'video-target') {
      console.log('video-target', detail.position)
    }
  }

The only time the jellyfish model would be positioned to 0, 0, 0 is before showTarget is called, as a position hasn’t explicitly been set on the object3d.

Regarding camera position, if disableWorldTracking is set to true, the camera position should never change unless done so in app code. When disableWorldTracking is set to false it’s expected the camera position will update relative to the user’s movement.

Feel free to share more code snippets you’re testing with or your project(s) with the support workspace if you need further help debugging.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.