简体   繁体   中英

How to change the augmented reality camera in three.js?

As the example, I try to set up the AR scene in three.js.

I use "jsartoolkit" to do that.

WebAR

I load a JSON model into the AR scene, and it does work.

Now I wonder how could I do to change the camera?

When I open the AR webpage, it always turn on the front device camera of my mobile phone.

I want to use the back device camera to show my WebAR scene.

How should I do?

Using cameraParam as a property name in your call to getUserMediaThreeScene may be incorrect.

Change:

cameraParam: 'Data/camera_para-iPhone 5 rear 640x480 1.0m.dat'

To:

video: { facingMode: { exact: "environment" }}

Reference: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia

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