首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从AR.js开始,文档示例不起作用

从AR.js开始,文档示例不起作用
EN

Stack Overflow用户
提问于 2021-11-16 08:45:12
回答 1查看 301关注 0票数 0

我从AR.js开始,有很多问题,所以我试着重新开始学习基础知识。

我确实想将gltf文件放在自定义标记的顶部。

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

代码语言:javascript
复制
<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

然而,当我试图打开它,手机状态在“加载,请等待”永远。

我在某个地方读到,你必须用它来定义你的资产,但不能让它工作,我会感谢任何我能得到的帮助。

非常感谢。

亲切的问候。

EN

回答 1

Stack Overflow用户

发布于 2022-04-22 17:38:37

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

我多次尝试打开图像跟踪示例,但它总是“加载,请等待”。

我怀疑,如果我打开基于位置的例子的代码,它是有效的。

然后,我打开了两个例子的代码和图像跟踪一个工作。我不知道为什么,但我能做得很好。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69986084

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档