Hi, I am trying to add some HolographicButtons to the scene, and use createDefaultVRExperience to make the scene become VR mode. But if I use createDefaultVRExperience, those added buttons cannot show on the scene. I am wondering if there is any method that can show those buttons in VR mode.
Thanks!
Hi,
I would first suggest to use the WebXR experience helper, as VR is already deprecated (and removed on chrome).
Second - want to share a playground of what you are trying to achieve?
Sounds like you maybe are using the Fullscreen GUI, which does not support VR? If you want to see in VR then you need to create a plane and apply the ADT to the plane.
I tried your first solution, but I don’t know how to enter VR mode. And second, please refer to Babylon.js Playground.
Thanks!
Sorry I don’t know what is ADT.
the playground doesn’t quite work, I assume you meant that - https://www.babylonjs-playground.com/#FQ0EE3#2 ?
Note that VR “falls back” to XR on chrome, so if you are using chrome, you are already using XR.
You can read about XR here:
https://doc.babylonjs.com/how_to/introduction_to_webxr
And once the playground is working, you get the button in XR/VR:
I should have remembered that the HolographicButtons are 3D controls, so you can disregard what I said. The ADT is Advanced Dynamic Texture (for 2D GUI)
Thanks. But your modification made the view “out of” the 360 video. My purpose is to play the 360 video in VR mode and show those buttons.
it wasn’t modification, the playground didnt work. If you need our help, we need to be able to understand what you are trying to achieve. Please create a working playground, with no console errors, and we can take it from there
Thanks. I think now is ok. https://www.babylonjs-playground.com/#FQ0EE3#3
In the playground I can see the added button, but the problem is the position of the button. If I don’t use VR mode, the added button is in front of me, but if I use VR mode, I need to rotate the view to see the added button. Also, I am unable to see it in my local environment. Is it something related to the version? Because I am using a previous version of GUI JS in my local environment.
Even in non-vr, the button is not positioned in front of you:
If you position the panel in front of you (positive z) it will be in front of you:
https://www.babylonjs-playground.com/#FQ0EE3#4
about vr/xr - when entering XR (not WebVR) the camera initializes in the viewing direction of the native camera. In VR you will need to reset the view to the right direction in order to do that.
** EDIT** - no idea why it was uploaded in such a bad quality, but i hope you can see what I mean.
Thanks! I will try it out.