【问题标题】:Aframe and AR.js does not show my .gltf modelAframe 和 AR.js 不显示我的 .gltf 模型
【发布时间】:2020-07-06 06:20:17
【问题描述】:

我是 aframe 和 arjs 的新手,我想通过 hiro 路径展示我自己的 gltf 模型,我编写了以下代码:

<!-- include A-Frame obviously -->
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
<!-- include ar.js for A-Frame -->
<script src="https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js"></script>

<body style='margin : 0px; overflow: hidden;'>
  <a-scene embedded arjs>
    <!-- define your gltf asset -->
    <!--This is for add a text-->
    <a-text value="Hello, World!"></a-text>
    <a-assets>
      <a-asset-item id="tree" src="models/gltf/manovella.gltf"></a-asset-item>
    </a-assets>
    <a-entity gltf-model="##tree"></a-entity>
    <!-- define a camera which will move according to the marker position -->
    <a-marker-camera preset='hiro'></a-marker-camera>
  </a-scene>
</body>

当我运行我的代码并从摄像头中系上一个 hiro 标记时,我只看到“Hello world!”文本而不是我自己的模型,我检查浏览器控制台错误但我没有生成任何东西。

有人可以帮我一下吗?我在哪里加载自己的模型错了?

提前非常感谢

【问题讨论】:

  • 尝试使用 arjs 和 aframe 的 newest versions,如果这没有帮助,请尝试在没有 ar.js 的情况下查看模型 - 也许它很大,或者偏离中心。
  • 应该是gltf-model="#tree",而不是"##tree",我觉得只是打错了
  • @StéphaneAlbanese 不错,我也认为 aframe 0.6.0 还不支持 gltf 2.0。

标签: three.js aframe ar.js


【解决方案1】:

尝试使用 A-Frame 0.8.2 版。正如Stéphane Albanese 提到的,您在##tree 中有一个额外的#

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-16
    • 2020-06-08
    • 2022-12-02
    • 2020-05-31
    • 2020-07-04
    • 1970-01-01
    • 2019-10-06
    • 1970-01-01
    相关资源
    最近更新 更多