首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ar.js无法显示glb模型

Ar.js无法显示glb模型
EN

Stack Overflow用户
提问于 2020-05-18 03:33:22
回答 1查看 718关注 0票数 1

我不能显示我的https://ignaciostellino.github.io./图像跟踪使用ar.js,请检查我的网页,我能够识别图像,但不能显示3D模型。我猜应该与规模和位置有关,但无法弄清楚。这是我的代码:

代码语言:javascript
复制
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1c2407b26c61958baa93967b5412487cd94b290b/dist/aframe-master.min.js"></script>
<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 -->
    <!-- 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" -->
    <a-nft
      type="nft"
      url="ignaciostellino.github.io/smoothie-peque/smoothie-peque"
      smooth="true"
      smoothCount="10"
      smoothTolerance=".01"
      smoothThreshold="5"
    >
    <!-- 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 gltf-model="Water/out.glb" scale="5 5 5"
            position="50 150 0" crossorigin="anonymous">
        <a-animation attribute="rotation" to = "360 0 0" dur="3000" easing="linear" repeat="indefinite"> </a-animation>
      </a-entity>
    </a-nft>
    <a-entity camera></a-entity>
  </a-scene>
</body>
EN

回答 1

Stack Overflow用户

发布于 2020-06-27 01:49:15

我不确定问题出在哪里,也许你的模型太小或太大。如何确定标记已被检测到?尝试使用<a-gltf-model>而不是<a-entity>。您还可以使用我们的platform echoAR上传您的模型,并立即获得AR.js体验链接(了解如何使用here)。您可以将您的代码与自动生成的代码进行比较,或者只使用您获得的ARjs链接。

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

https://stackoverflow.com/questions/61857644

复制
相关文章

相似问题

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