Aframe和AR.js没有显示我的.gltf模型

时间:2020-07-06 06:20:17

标签: three.js aframe ar.js

我是关于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!”文字,而不是我自己的模型,我检查浏览器控制台错误,但未生成任何内容。

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

非常感谢

1 个答案:

答案 0 :(得分:0)

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