【发布时间】:2020-09-30 02:26:11
【问题描述】:
我正在尝试根据网站上的教程制作一个简单的arjs应用程序,特别是this one
我已经能够成功地将其他 gltf 模型换成新代码,但是每当我尝试使用自己的模型时,它们都不会显示在应用程序中。
我已经在 https://gltf-viewer.donmccurdy.com/ 的查看器中测试了我的模型,它显示得很好。
我的代码如下。
<body style='margin : 0px; overflow: hidden;'>
<!-- we add detectionMode and matrixCodeType to tell AR.js to recognize barcode markers -->
<a-scene embedded vr-mode-ui="enabled: false" arjs="sourceType: webcam; debugUIEnabled: false; detectionMode: mono_and_matrix; matrixCodeType: 3x3;">
<a-assets>
<a-asset-item id="animated-asset" src="https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Duck/glTF/Duck.gltf"></a-asset-item>
<a-asset-item id="bimmer" src="https://raw.githubusercontent.com/jaggre/consortium/master/compresso.gltf"></a-asset-item>
</a-assets>
<a-marker type='barcode' value='2'>
<a-entity
animation-mixer
gltf-model="#bimmer"
scale="4 4 4">
</a-marker>
<a-marker id="animated-marker" type='barcode' value='6'>
<a-entity
animation-mixer
gltf-model="#animated-asset"
scale="2 2 2">
</a-entity>
</a-marker>
<a-entity camera></a-entity>
</a-scene>
</body>
【问题讨论】:
-
可能是你的模型太大了,也许你要缩小它...