在我的AR.JS示例https://github.com/ybinstock/aframe_ar (github) https://ybinstock.github.io/aframe_ar(实时网站)上,我在附图中看到了这两个框.
这是我的aframe场景
<a-scene embedded arjs>
<a-assets>
<a-asset-item id="drone" src="busterDrone/busterDrone.gltf"></a-asset-item>
<a-asset-item id="helmet" src="damagedHelmet/damagedHelmet.gltf"></a-asset-item>
<a-asset-item id="skull" src="skull_downloadable/scene.gltf"></a-asset-item>
</a-assets>
<a-marker-camera preset='hiro'>
<a-entity gltf-model-next="#drone"></a-entity>
</a-marker-camera>
</a-scene>
Run Code Online (Sandbox Code Playgroud) 所有通过浏览器演示 AR.js AR 功能的示例和代码在网页加载后即可运行。不过,我想为用户提供一个选项,手动启动和停止扫描过程以及隐藏 AR 内容。
基本上,我想仅在用户单击网页上的按钮时加载 a-frame、AR.js 脚本和其他 a-frame html 元素。
请告诉我 AR.js 中是否有任何参数可以传递以表明用户启动相机/扫描/显示我们的内容的意图。
脚本版本:
A-Frame 版本:0.7.1(日期 18-10-2017,提交 #b9a751e)
三个版本:^0.87.0
WebVR Polyfill 版本:^0.9.36
我正在尝试检测何时在ar.js中找到/丢失标记,同时使用a-frame.
从我在源代码中看到的,当找到标记时,应该触发'getMarker'事件,而且artoolkit似乎派遣了一个markerFound事件.
我试图听那些事件的<a-scene>,或上<a-marker>,但似乎我现在不是弄错了,或者我需要得到更深层次的arController,或arToolkit对象.
当我记录场景或标记时,我只获得对属性的引用,这些属性似乎没有附加上述对象.(例如marker.arController,或marker.getAttribute('artoolkitmarker').arController)
有没有人试过这个并有任何提示如何做到这一点?
我想知道 Ar.js 是如何工作的,但我一直在创建自定义标记和自定义形状,有什么方法可以自定义东西。
这就是我要开始的事情。
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
<!-- include ar.js for A-Frame -->
<script src="https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js"></script>
<body style='margin : 0px; overflow: hidden;'>
<a-scene embedded arjs>
<!-- create your content here. just a box for now -->
<a-box position='0 0.5 0' material='opacity: 0.5;'></a-box>
<!-- define a camera which will move according to the marker position -->
<a-marker-camera preset='hiro'></a-marker-camera>
</a-scene>
</body>
Run Code Online (Sandbox Code Playgroud)
这是入门的简单示例
我已经阅读了官方文档,但无法找到有关放大/缩小panorama图像的可能性的信息,它是否在 A-Frame 中受支持,或者可能有一种解决方法可以阅读有关three.js在其上实现的一些内容?