【问题标题】:Starting with AR.js the documentation example does not work从 AR.js 开始,文档示例不起作用
【发布时间】:2022-04-23 01:38:37
【问题描述】:

我从 AR.js 开始,遇到很多问题,所以我尝试从基础重新开始。

我确实想在自定义标记上放置一个 gltf 文件

我在 (https://ar-js-org.github.io/AR.js-Docs/#troubleshooting-feature-requests-community) 的文档中查看了图像跟踪示例:

<script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar-nft.js"></script>

<style>
  .arjs-loader {
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .arjs-loader div {
    text-align: center;
    font-size: 1.25em;
    color: white;
  }
</style>

<body style="margin : 0px; overflow: hidden;">
  <!-- minimal loader shown until image descriptors are loaded -->
  <div class="arjs-loader">
    <div>Loading, please wait...</div>
  </div>
  <a-scene
    vr-mode-ui="enabled: false;"
    renderer="logarithmicDepthBuffer: true;"
    embedded
    arjs="trackingMethod: best; sourceType: webcam;debugUIEnabled: false;"
  >
    <!-- we use cors proxy to avoid cross-origin problems -->
    <a-nft
      type="nft"
      url="https://arjs-cors-proxy.herokuapp.com/https://raw.githack.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex/trex-image/trex"
      smooth="true"
      smoothCount="10"
      smoothTolerance=".01"
      smoothThreshold="5"
    >
      <a-entity
        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"
        scale="5 5 5"
        position="50 150 0"
      >
      </a-entity>
    </a-nft>
    <a-entity camera></a-entity>
  </a-scene>
</body>

我复制了代码并进行了一个故障项目:

https://glitch.com/edit/#!/discreet-horn-fog?path=index3.html%3A54%3A7

但是,当我尝试打开它时,手机一直显示“正在加载,请稍候”。

我在某个地方读到了你必须使用的东西 要定义您的资产但无法使其发挥作用,我将不胜感激。

非常感谢。

亲切的问候。

【问题讨论】:

    标签: javascript three.js augmented-reality aframe ar.js


    【解决方案1】:

    我在https://ar-js-org.github.io/AR.js-Docs/打开项目时遇到了同样的问题

    我多次尝试打开图像跟踪示例,但总是“加载中,请稍候”。

    我注意到,如果我打开基于位置的示例的 Codepen,它就可以工作。

    然后我打开了两个示例的 Codepen 以及图像跟踪的一个都可以工作。我不知道为什么,但我能够做到这一点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多