joshcamas Posted May 23, 2017 Share Posted May 23, 2017 Hey guys, I'm looking for a downloadable vr example... no 2D gui, nothing like that.... all I want is a flat plane. I'm having trouble finding anything like this, it's sad cause all I can find is three.js examples I don't wanna use three.js Anything like this out there? Also, does webvr in babylon support webvr-polyfill? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted May 23, 2017 Share Posted May 23, 2017 Here is a small sample: http://www.babylonjs-playground.com/#8JJWNB Basically, the only difference is you use WebVRFreeCamera instead of FreeCamera. You do not need any polyfill as all the fallbacks have been integrated natively in BJS. Hope that will help you achieve your goals with BJS. Dad72 1 Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted May 23, 2017 Share Posted May 23, 2017 How do you sent scene to the headset ? In your playground I have orientation which works, but nothing showed on headset (HTC Vive here). Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 23, 2017 Share Posted May 23, 2017 Or use VRDeviceOrientationFreeCamera http://www.babylonjs-playground.com/#8JJWNB#1 (this work here) This is for select the camera: let vrCameraMetrics = BABYLON.VRCameraMetrics.GetDefault(); vrCameraMetrics.vScreenSize *= 0.25; if(navigator.getVRDisplays) { camera = new BABYLON.WebVRFreeCamera("WebVRFreeCamera", BABYLON.Vector3.Zero(), scene, vrCameraMetrics); } else { camera = new BABYLON.VRDeviceOrientationFreeCamera("VRDeviceOrientationFreeCamera", new BABYLON.Vector3(0, 1.5, 0), scene, false, vrCameraMetrics); } Quote Link to comment Share on other sites More sharing options...
Sebavan Posted May 23, 2017 Share Posted May 23, 2017 It is well the Webvrfreecamera to use but i forgot to start it on a user event like a click. actually, webvr needs to be started from a user event for security purpose, i ll update the playground in a couple of hours (on my phone currently) V!nc3r 1 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted May 23, 2017 Share Posted May 23, 2017 http://www.babylonjs-playground.com/#8JJWNB#2 Click on the FPS counter to start in VR Mode. V!nc3r 1 Quote Link to comment Share on other sites More sharing options...
davrous Posted May 23, 2017 Share Posted May 23, 2017 Otherwise, you've got the documentation: http://doc.babylonjs.com/overviews/webvr_camera, 2 videos we've made: - https://channel9.msdn.com/events/Build/2017/P4097 - https://channel9.msdn.com/events/Build/2017/T6987 And some samples: - loading a scene and switching to VR (with feature detection for fallback): http://playground.babylonjs.com/#YITJU9#2 - a relatively simple 3D scene using the same approach: http://playground.babylonjs.com/#ASDZLT#2 And as @Sebavan said, you need a user's interaction to render the scene in the headset (at least required by Chrome as far as I remember, not sure it's specified by the spec). Your feedback is interesting as I'm currently working on a tutorial on WebVR and Babylon.js. I'll integrate a very simple sample based on what you're suggesting. Thanks, David V!nc3r and joshcamas 2 Quote Link to comment Share on other sites More sharing options...
joshcamas Posted May 24, 2017 Author Share Posted May 24, 2017 Awesome! I'm so excited to get into this! With cardboard, you can scan a code to load headset parameters... My headset isn't aligned with the default babylon/webvr settings, are there variables I can change on my own? It'd be really cool if there was a database, and we could implement a camera taking a picture of it, scanning the qr code, accessing the database, and setting the webvr settings... but for now I just wanna hardcode in those settings Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.