简体   繁体   English

更新的问题 - 如何使用 ARJS 和 Aframe 设置正确的设备相机?

[英]Updated Question - How to set the correct device camera with ARJS and Aframe?

I'm using the aframe with ARJS to build an Augmented Reality app.我将 aframe 与 ARJS 结合使用来构建增强现实应用程序。 What I'm trying to do is to set the camera to stay fixed with my device camera.我想要做的是将相机设置为与我的设备相机保持固定。 when I run my app I see the camera shifted up and left.当我运行我的应用程序时,我看到相机向上和向左移动。 This causes my AR video to be out of the image tracker area.这会导致我的 AR 视频超出图像跟踪器区域。

This is a question related to my question: Is there a way to set the default camera direction when a page loads, in a-frame?这是一个与我的问题相关的问题: 有没有办法在页面加载时在框架中设置默认相机方向?

Appreciate any help.感谢任何帮助。

[UPDATE] [更新]

I found out that what is actually happening, is that the Aframe camera is selecting my wide-angle camera (Samsung A51).我发现实际发生的事情是 Aframe 相机正在选择我的广角相机(三星 A51)。 There is an open issue on the ARJS repository. ARJS 存储库上有一个未解决的问题

If someone knows how to avoid this issue, please leave your anwser.如果有人知道如何避免这个问题,请留下您的答案。

Changing the Active Camera When the active property gets toggled, the component will notify the camera system to change the current camera used by the renderer:更改活动相机当激活属性被切换时,组件将通知相机系统更改渲染器使用的当前相机:

var secondCameraEl = document.querySelector('#second-camera');
secondCameraEl.setAttribute('camera', 'active', true);

see - https://aframe.io/docs/1.3.0/components/camera.html#changing-the-active-camera请参阅 - https://aframe.io/docs/1.3.0/components/camera.html#changing-the-active-camera

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

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