A-Frame AR.js 自定义 AR 标记不起作用

问题描述 投票:0回答:1

我读过很多帖子,包括这篇非常详尽且冗长的文章,位于 https://github.com/jeromeetienne/AR.js/issues/164,以及 https://medium.com/ chialab-开源/ar-js-获取跨浏览器-ar-on-the-web-8f670dd45462的最简单方法。但我仍然无法让我的自定义标记工作。

我设计了16*16,上传到https://jeromeetienne.github.io/AR.js/third.js/examples/marker-training/examples/generator.html,但同样,什么也没有显示除了 hiro 和 kanji 预设...

我的代码如下:

<!DOCTYPE html>
<html lang="en" dir="ltr">
<!-- Marker-based AR -->
  <!-- NOTE: Cannot work on local server -->
  <!-- NOTE: multiple a-marker-camera can work at the same time, but if the object is defiend outside, they can appear on one marker at a time -->
  <!-- AR.js by @jerome_etienne - github: https://github.com/jeromeetienne/ar.js - info: https://medium.com/arjs/augmented-reality-in-10-lines-of-html-4e193ea9fdbf -->
  <head>
    <script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.5.0/aframe/examples/vendor/aframe/build/aframe.min.js"></script>
    <script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.5.0/aframe/build/aframe-ar.js"></script>
  </head>
  <body style='margin : 0px; overflow: hidden;'>
    <a-scene embedded arjs='sourceType: webcam; debugUIEnabled: false'>
        <a-sphere position="0 0.5 0" radius="0.5" color="#EF2D5E"></a-sphere>
        <a-plane position="0 0 0" rotation="-90 0 0" width="1" height="1" color="#7BC8A4"></a-plane>
        <a-marker-camera preset='hiro'></a-marker-camera>
      <a-marker-camera type="pattern" url="Markers_AR/pattern-Simple.patt"></a-marker-camera>
      <a-marker-camera type="pattern" url="Markers_AR/pattern-Simple2.patt"></a-marker-camera>
    </a-scene>
  </body>
</html>


任何帮助将不胜感激!

aframe
1个回答
0
投票

是的,只需将参考脚本更改为1.5.5版本即可。然后就全部解决了

来源:https://github.com/jeromeetienne/AR.js/issues/216

© www.soinside.com 2019 - 2024. All rights reserved.