Jump to content

Remove Round Frames in VR


Lary
 Share

Recommended Posts

Hi there,

Now I have a basic webVR demo from PG, when I enter into VR mode, there always be round frames/corners (below pic in red circle )at each view. 

Is there a way to remove them, and make the view on both side in full screen? 

Thanks!

vr.png

Link to comment
Share on other sites

Hi Lary!

@JCPalmer created a "stereoscopic" camera rig named... BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL.  (I think he created _SIDEBYSIDE_CROSSEYED and _OVERUNDER versions, too)

You can see side-by-side... in action... here.  http://playground.babylonjs.com/#CV4CX#1

Maybe this will work for you.  Otherwise, stay tuned... others will have more info/other ideas.

Link to comment
Share on other sites

When entering VR and not WebVR headset is available, Babylon.js will revert back to a VRDeviceOrientationFreeCamera

You can force the camera to NOT compensate for lens with the fourth parameter:

var camera = new BABYLON.VRDeviceOrientationFreeCamera("DevOr_camera", new BABYLON.Vector3(0, 0, 0), scene, false);

doc: http://doc.babylonjs.com/api/classes/babylon.vrdeviceorientationfreecamera#constructor

Link to comment
Share on other sites

On 6/1/2018 at 9:43 PM, Wingnut said:

Hi Lary!

@JCPalmer created a "stereoscopic" camera rig named... BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL.  (I think he created _SIDEBYSIDE_CROSSEYED and _OVERUNDER versions, too)

You can see side-by-side... in action... here.  http://playground.babylonjs.com/#CV4CX#1

Maybe this will work for you.  Otherwise, stay tuned... others will have more info/other ideas.

Hi @Wingnut, thanks for the information,@JCPalmer 's camera works in my scene. Great!

However, the scene in both view seems kinda tortured. 

What I'm using is scene.createDefaultVRExperience({createDeviceOrientationCamera:false}); which will create a webVR camera and non-webVR camera, and also a button enabling webVR access.

I want this mode ,and keep both cameras. So by default, it is arcRotateCamera, when webVR triggers, the view has to be side by side with no round borders as above show. 

I wonder if there's a way? or I just need to correct a parameter?

 

 reference link  here, in this demo, if I enter webvr mode there, it's side by side with no borders, but if I download the code and play at local, there has round corners, I don't know why....

 

Link to comment
Share on other sites

Hi Lary

Here ya go...

https://www.babylonjs-playground.com/#TAFSN0#27

Should work.

Line 31... I dump scene.cameras to console.  It shows 5 cameras... 0-4.

At console, I clicked on each camera object,  which views that object in an object inspector.

scene.cameras[1] had a ._rigCameras array with a length of TWO.  I assumed that was the stereo cam.

So then... we just need to change the rigMode on that camera... just like we did in the previous playgrounds.  Line 33 does it.

Hope this works.  Report back, as wanted. 

By the way... that was a PERFECT playground example... it made my helping... easy to do.  Thx for that... well done.

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