Aframe GLTF未使用ar.js显示

Aframe GLTF未使用ar.js显示,aframe,gltf,ar.js,Aframe,Gltf,Ar.js,我目前正在测试AR.js,用手机在增强现实中显示3D模型。我的网页编码技能是非常新手,所以我正在收集不同的教程,以得到我想要的。我相信我已经确定了正确显示gltf文件所需的内容,但似乎存在一些小问题,因为模型无法显示。我已使用gltf查看器确认该文件是有效的。代码也可以很好地显示一个简单的a-box,但是当我注释掉它并为gltf模型添加行时,代码就会下降 任何帮助都将不胜感激 <html> <head> <meta name="viewpo

我目前正在测试AR.js,用手机在增强现实中显示3D模型。我的网页编码技能是非常新手,所以我正在收集不同的教程,以得到我想要的。我相信我已经确定了正确显示gltf文件所需的内容,但似乎存在一些小问题,因为模型无法显示。我已使用gltf查看器确认该文件是有效的。代码也可以很好地显示一个简单的a-box,但是当我注释掉它并为gltf模型添加行时,代码就会下降

任何帮助都将不胜感激

<html>
    <head>
         <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
         <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
         <script src="https://raw.githack.com/jeromeetienne/AR.js/2.2.1/aframe/build/aframe-ar.js"></script>
    </head>

    <body style='margin : 0px; overflow: hidden;'>
        <a-scene embedded arjs='sourceType: webcam; debugUIEnabled: true;'>

            <a-marker preset="hiro">
            <!--<a-box position='0 0.5 0' material='color: yellow;'></a-box>-->
            <a-entity gltf-model="url(https://tests.offtopicproductions.com/ywca.gltf)"></a-entity>
            </a-marker>
            <a-entity camera></a-entity>
        </a-scene>
    </body>
 </html>
您可以浏览新的示例,其中有一个gltf模型,还有一个。 在您提供的示例中,您应该进行此更改

由此:

<a-entity
 gltf-model="url(https://tests.offtopicproductions.com/ywca.gltf)"></a-entity>
避免资源不在同一主机中时出现CORS问题。 AR.js在一个新的github组织下,所有的资源库和文档现在都在这里

<a-entity gltf-model="https://arjs-cors-proxy.herokuapp.com/https://tests.offtopicproductions.com/ywca.gltf"></a-entity>
https://arjs-cors-proxy.herokuapp.com/