【问题标题】:arjs - aframe | Working Devices & Webcamsarjs - aframe |工作设备和网络摄像头
【发布时间】:2020-06-09 06:42:30
【问题描述】:

我在我的 Angular 项目中使用了简单的 arjs 示例,但我无法使用 hiro 标记获得任何结果。

这是代码:

<a-scene embedded arjs>
    <a-box position='0 0.5 0' material='opacity: 0.5;'></a-box>
    <a-marker-camera preset='hiro'></a-marker-camera>
</a-scene>

当我将智能手机指向 hiro 标记时,什么也没有发生。

这是因为我的设备不支持 AR 吗?我有一个小米红米note 6 pro。

我了解到,为了让 AR 在设备上运行,我需要拥有我的设备不支持的 AR Google 服务。

arjs 是否需要 AR 谷歌服务才能工作?如果不是什么是 其他原因?

附言。

  1. 我在 https 并且摄像头已打开。
  2. 我在一个 Angular 项目中,我正在将脚本导入到 index.html 头

这些是脚本:

  <script src="https://aframe.io/releases/0.8.0/aframe.min.js"></script>
  <script src="https://cdn.rawgit.com/jeromeetienne/AR.js/master/aframe/build/aframe-ar.js"> </script>

【问题讨论】:

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


    【解决方案1】:

    据我所知arjs 不需要AR Google Services 才能工作

    我认为问题是你需要把你的对象,也就是&lt;a-box&gt;,放在&lt;a-marker&gt;里面

    试试:

    <!DOCTYPE html>
    <html>
        <script src="https://aframe.io/releases/1.0.0/aframe.min.js"></script>
        <!-- we import arjs version without NFT but with marker + location based support -->
        <script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
        <body style="margin : 0px; overflow: hidden;">
            <a-scene embedded arjs>
                <a-marker preset="hiro">
                    <a-box position='0 0.5 0' material='opacity: 0.5;'></a-box>
                </a-marker>
               <a-entity camera></a-entity>
            </a-scene>
        </body>
    </html>
    

    您还可以在此处查看另一个示例:https://github.com/AR-js-org/AR.js/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多