aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.71k stars 3.98k forks source link

Arjs cannot work in immersive mode #4746

Closed ericdacal closed 3 years ago

ericdacal commented 3 years ago

I'm developing a app with Arjs and Magic Leap 1, when I use Image Tracking in inline mode works well but when I use in immersive mode cannot works. The code use is the following:

<!DOCTYPE html>
<html>
  <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
  <!-- we import arjs version without NFT but with marker + location based support -->
  <script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
  <body style="margin : 0px; overflow: hidden;">
    <a-scene embedded arjs>
      <a-marker preset="hiro">
        <a-entity
          position="0 0 0"
          scale="0.05 0.05 0.05"
          gltf-model="https://arjs-cors-proxy.herokuapp.com/https://raw.githack.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex/scene.gltf"
        ></a-entity>
      </a-marker>
      <a-entity camera></a-entity>
    </a-scene>
  </body>
</html>
dmarcos commented 3 years ago

I don't have a Magic Leap 1 to test with and ar.js maintainers will be better equipped to answer your questions. Your problem is likely not an issue with A-Frame but related to how ar.js is architected.

As far as I know ar.js is designed to work with phones in magic window configuration. The camera feed is rendered in a <video> element, set as the page background with 3D content overlayed on top. In immersive mode only WebGL content can be rendered so something has to be done for transparent pass through display.

I suppose you would want to replace the camera feed with the real world view. I don't think ar.js accounts for that use case or it's tested in head mounted AR devices. I encourage contacting ar.js folks. It will help them investigate if you also provide a browser console log since Magic Leap 1 devices are not easily available.

I don't think there's anything actionable on the A-Frame side. Good luck with your project