【发布时间】:2019-10-28 04:40:40
【问题描述】:
您好,我是 Aframe 和 AR.js 的新手。我正在尝试加载 glft(尝试了一些),但是在测试时,即使模型很小,我也会得到一个带有点的蓝色加载屏幕。
我已经验证了该文件,并在 glft 查看器中在线进行了测试,该文件很好。
谁能看到导致模型无法加载的原因以及我做错了什么?我使用了在网上找到的现有代码,他们的模型运行良好。
我尝试过使用另一种型号 glb,但也不起作用。对于 glft,.bin 位于我的 S3 存储桶上的同一文件夹中。
谢谢!
<!doctype HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
</head>
<script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
<script src="https://raw.githack.com/jeromeetienne/AR.js/2.0.5/aframe/build/aframe-ar.js">. </script>
<!-- add this script in order to load a large set of 3D model extensions-->
<script src="https://rawgit.com/donmccurdy/aframe-extras/master/dist/aframe-extras.loaders.min.js"></script>
<body style='margin : 0px; overflow: hidden;'>
<!-- we add detectionMode and matrixCodeType to tell AR.js to recognize barcode markers -->
<a-scene embedded arjs='sourceType: webcam; debugUIEnabled: false ;detectionMode: mono_and_matrix; matrixCodeType: 3x3; ' >
<a-assets>
<a-asset-item id="animated-asset" src="https://arliveevent.s3.eu-west-2.amazonaws.com/starbucks_grande_coffee_cup_caution_hot/scene.gltf"></a-asset-item>
</a-assets>
<a-marker type='barcode' value='7'>
<a-box position='0 0.5 0' color="yellow"></a-box>
</a-marker>
<a-marker type='barcode' value='6'>
<a-entity gltf-model="#animated-asset" scale="0.5 0.5 0.5">
</a-entity>
</a-marker>
<!-- use this <a-entity camera> to support multiple-markers, otherwise use <a-marker-camera> instead of </a-marker> -->
<a-entity camera></a-entity>
</a-scene>
</body>
</html>
【问题讨论】: