简体   繁体   中英

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

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). There is an open issue on the ARJS repository.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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