Jump to content

WebVRFreeCameraID vs VRDeviceOrientationFreeCamera


ian
 Share

Recommended Posts

I get error in chrome/firefox/opera browser ( I have those browsers lattest stable versions):
if I type in browser console command :  or 
 
command:
navigator.getVRDevices()
output:
navigator.getVRDevices()
VM133:1 Uncaught TypeError: navigator.getVRDevices is not a function
    at <anonymous>:1:11
--------------------------------
command:
navigator.getVRDevices().then((vrs) => {console.log(vrs.length)})
output:
Uncaught TypeError: navigator.getVRDevices is not a function
    at <anonymous>:1:11
 
 
Link to comment
Share on other sites

OK I SOLVE.

If you want to use WebVR (Browser which support VR (with javascript navigator.getVRDevices())
 

(MOBILE for CarbonVR) or just Mobile (If you dont have VR DEVICE/GOOGLES)

FOR ANDROID
You have to download "
Chrome Canary (Unstable)" and then In the URL bar, load chrome://flags#enable-webvr and toggle the Enable WebVR flag.

(here: https://webvr.rocks/chrome_for_android) after that you restar chrome canary and Babylon WebVR works (left/right side). (so only so WebVRFreeCameraID works OK else browser not supporter.... to new..)

Link to comment
Share on other sites

WebVRFreeCamera is using the WebVR specification available in Edge Creators Update, Firefox 55 and some specific build of Chromium. It's also available on Gear VR and DayDream. It better address WebVR devices and also expose gamepad extesion to use the VR controllers.

VRDeviceOrientationFreeCamera is a fallback camera based on the Device Orientation API. It mimics a bit the WebVR one using the accelerometer of the smartphone and doing a double rendering of the scene with lens distortion handled (can be disabled). 

You need to feature detect WebVR in your code to use either WebVR or Device Orientation. Here's a sample showing the best practice to use (using Sponza as a demo): http://playground.babylonjs.com/#QWIJYE#1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...