我从AR.js开始,有很多问题,所以我试着重新开始学习基础知识。
我确实想将gltf文件放在自定义标记的顶部。
我访问了(https://ar-js-org.github.io/AR.js-Docs/#troubleshooting-feature-requests-community)的文档,查看了图像跟踪示例:
<script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar-nft.js"></script>
<style>
.arjs-loader {
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.8);
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
}
.arjs-loader div {
text-align: center;
font-size: 1.25em;
color: white;
}
</style>
<body style="margin : 0px; overflow: hidden;">
<!-- minimal loader shown until image descriptors are loaded -->
<div class="arjs-loader">
<div>Loading, please wait...</div>
</div>
<a-scene
vr-mode-ui="enabled: false;"
renderer="logarithmicDepthBuffer: true;"
embedded
arjs="trackingMethod: best; sourceType: webcam;debugUIEnabled: false;"
>
<!-- we use cors proxy to avoid cross-origin problems -->
<a-nft
type="nft"
url="https://arjs-cors-proxy.herokuapp.com/https://raw.githack.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex/trex-image/trex"
smooth="true"
smoothCount="10"
smoothTolerance=".01"
smoothThreshold="5"
>
<a-entity
gltf-model="https://arjs-cors-proxy.herokuapp.com/https://raw.githack.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex/scene.gltf"
scale="5 5 5"
position="50 150 0"
>
</a-entity>
</a-nft>
<a-entity camera></a-entity>
</a-scene>
</body>我复制了代码并进行了一个故障项目:
https://glitch.com/edit/#!/discreet-horn-fog?path=index3.html%3A54%3A7
然而,当我试图打开它,手机状态在“加载,请等待”永远。
我在某个地方读到,你必须用它来定义你的资产,但不能让它工作,我会感谢任何我能得到的帮助。
非常感谢。
亲切的问候。
发布于 2022-04-22 17:38:37
我在https://ar-js-org.github.io/AR.js-Docs/上打开这个项目时也遇到了同样的问题
我多次尝试打开图像跟踪示例,但它总是“加载,请等待”。
我怀疑,如果我打开基于位置的例子的代码,它是有效的。
然后,我打开了两个例子的代码和图像跟踪一个工作。我不知道为什么,但我能做得很好。
https://stackoverflow.com/questions/69986084
复制相似问题