Jump to content

SUPER simple webvr example?


joshcamas
 Share

Recommended Posts

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? :)

Link to comment
Share on other sites

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);
}

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :)

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