【问题标题】:Ar.js with a-frame: user controls where the ar object appears?带有 a-frame 的 Ar.js:用户控制 ar 对象出现的位置?
【发布时间】:2018-05-29 18:06:46
【问题描述】:

我发现这种方法可以在浏览器应用程序中构建增强现实,因此无需安装即可运行它。我能够控制它绘制的 ar 对象,但不能控制它绘制它的时间和地点

<script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.5.0/aframe/build/aframe-ar.js"></script>

<body style='margin : 0px; overflow: hidden;'>
<a-scene embedded arjs='trackingMethod: best;'>
<a-anchor hit-testing-enabled='true'>
    <a-sphere position="0 0.5 0" material="opacity: 1;" color="red"></a-sphere>
</a-anchor>
<a-camera-static/>
</a-scene>
</body>

如果我将手机摄像头对准这张图片https://jeromeetienne.github.io/AR.js/data/images/HIRO.jpg,它会在其前面绘制一个球体。

有没有办法让它绘制我在屏幕上点击的球体,而不是在特定图像前面?有没有人能找到任何关于如何使用这个 ar.js 的指南?

【问题讨论】:

    标签: html three.js augmented-reality aframe ar.js


    【解决方案1】:

    ar.js 是基于标记的,如docs 中所述。

    使用 ar.js,您可以尝试通过点击屏幕来移动场景中的对象,但场景只会将自身定位在标记上。

    请记住 - 屏幕是 2D 平面,而您想在 3D 空间中移动对象 - 您可以沿 xy 移动它轴,取决于您在屏幕上触摸的位置,但这显然不是您想要实现的。


    您可以使用argon.js,但我不确定他们的 a-frame 支持是否仍然保持。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-02
      • 1970-01-01
      • 2020-01-12
      • 2021-09-18
      相关资源
      最近更新 更多