尽管提供了正确的路径,但无法在 ar.js 的以下 html 文件中加载 obj 文件:
<script src=”https://aframe.io/releases/0.6.1/aframe.min.js"></script>
<script src=”https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js"></script>
<body style=’margin : 0px; overflow: hidden;’>
<a-scene embedded arjs=’sourceType: webcam;’>
<a-marker preset=’hiro’>
<!-- Adding an OBJ file to an AR Project-->
<a-entity
obj-model=”obj: url(https://rishavjayswal.github.io/augmented-reality/resources/couch.obj);
mtl: url(https://rishavjayswal.github.io/augmented-reality/resources/couch.mtl)”>
</a-entity>
</a-marker>
<a-entity camera>
</a-entity>
</a-scene>
</body>
得到
获取https://rishavjayswal.github.io/augmented-reality/%E2%80%9Dhttps://aframe.io/releases/0.6.1/aframe.min.js%22 net::ERR_ABORTED
跑完之后。还尝试了 obj 和 mtl 文件的相对路径:
/资源/沙发.obj
可以在这里打开链接:https ://rishavjayswal.github.io/augmented-reality/