简体   繁体   English

arjs - aframe | 工作设备和网络摄像头

[英]arjs - aframe | Working Devices & Webcams

I am using the simple arjs example to my angular project but i cannot get any results using the hiro marker.我在我的 angular 项目中使用了简单的 arjs 示例,但我无法使用 hiro 标记获得任何结果。

This is the code:这是代码:

<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>

When I point my smartphone to a hiro marker nothing happens.当我将智能手机指向 hiro 标记时,没有任何反应。

Is this because my device is not supporting AR?这是因为我的设备不支持 AR 吗? I have a Xiaomi redmi note 6 pro.我有一个小米红米note 6 pro。

I read that in order for the AR to work on the device I need to have AR Google services which are not supported by my device.我读到了,为了让 AR 在设备上运行,我需要拥有我的设备不支持的 AR Google 服务。

Does arjs need AR google services in order to work? arjs 是否需要 AR 谷歌服务才能工作? If not what are the other reasons?如果不是,其他原因是什么?

PS. PS。

  1. I am on https and the camera is open.我在 https 并且相机是打开的。
  2. I am on an angular project and I am importing the scripts on the index.html head我在一个 angular 项目上,我正在导入 index.html 头上的脚本

these are the scripts:这些是脚本:

  <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>

As Far As I Know arjs does not need AR Google Services in order to work据我所知, arjs不需要AR Google Services来工作

I think the problem is you need to put the your object, which is <a-box> , inside the <a-marker>我认为问题是您需要将您的 object (即<a-box> )放入<a-marker>

Try:尝试:

<!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>

You can also see another example here: https://github.com/AR-js-org/AR.js/您还可以在此处查看另一个示例: https://github.com/AR-js-org/AR.js/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM