oschakravarthi Posted October 3, 2018 Share Posted October 3, 2018 Hi, In VR mode, I want to show a 3D GUI panel to the user when he clicks on a mesh. The user clicks on one of the buttons from that panel. Then the panel will be disappeared and the user will continue with his journey. I have few questions and confusion here. 1. Is using 3D Panel a right choice? 2. If the mesh the user clicks on is very close to the user, or the mesh is in a corner, there will not be much space for the 3D panel to be shown. other meshes in the scene will overlap with the 3D panel. Moreover, if a light is there in that position, the panel will get glare. So, everything else in the scene should be invisible while the panel is visible. How can I achieve this? Having panel in a different scene and toggling between these scenes is a good option? How can I toggle scenes in VR mode? From a VR scene, When I switch to the other scene, the other scene should continue in VR mode only. 3. I am experiencing a weird behavior with 3D Panel in VR. The moment I instantiate a 3D panel or 3D manager, my scene is becoming very big. I mean, assume that I am in a room. when I instantiate a 3D panel or 3D manager, the room becomes very big. I too become very big like a giant. My feet are 10 feet above the floor. Overall the entire environment is scaled 2 times. Any clue? Please guide me. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 3, 2018 Share Posted October 3, 2018 Would be amazing to have a playground with a repro. In the mean time I ll add @trevordev and @brianzinn to the conversation ? as they are our in house VR/XR experts. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted October 3, 2018 Share Posted October 3, 2018 I would not use a cylinder panel like you were, because it's too difficult to position when you are close to a wall. I would go with how the WinMR works and pop up a flat panel in front of the user, but away from walls/ground. My preferences I don't want to affect your design - I am not a good designer just pointing out what may be easier. 1 hour ago, oschakravarthi said: My feet are 10 feet above the floor. Overall the entire environment is scaled 2 times. Every unit is 1 meter in VR. Use that as a baseline everywhere. Toggling scenes in VR mode - use asset container: https://doc.babylonjs.com/how_to/how_to_use_assetcontainer trevordev 1 Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted October 3, 2018 Author Share Posted October 3, 2018 Thank you @brianzinn , I liked the approach you suggested. Do you have any demo or PG for showing a flat panel on the fly? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted October 3, 2018 Share Posted October 3, 2018 Not with 3D panel, but with regular 2D panel, you can do things like this: https://www.babylonjs-playground.com/#Q81PBV#5 You can check plane intersection manually and move when needed. Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted October 3, 2018 Author Share Posted October 3, 2018 excellent @brianzinn, Thank you. this is what I have been searching for. The main reason I picked 3D panel is, the arrangement of buttons is taken care by the panel itself. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted October 3, 2018 Share Posted October 3, 2018 OK, you may want to look at grid container, if you go with 2D panel: https://doc.babylonjs.com/how_to/gui#grid Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted October 5, 2018 Author Share Posted October 5, 2018 On 10/3/2018 at 10:35 PM, brianzinn said: I would not use a cylinder panel like you were, because it's too difficult to position when you are close to a wall. I would go with how the WinMR works and pop up a flat panel in front of the user, but away from walls/ground. My preferences I don't want to affect your design - I am not a good designer just pointing out what may be easier. Every unit is 1 meter in VR. Use that as a baseline everywhere. Toggling scenes in VR mode - use asset container: https://doc.babylonjs.com/how_to/how_to_use_assetcontainer Hi @brianzinn and @trevordev , I have re-written all my stuff using asset containers. But facing some issues. I have modified an existing PG to reproduce the issue. Please have a look at this https://www.babylonjs-playground.com/#JA1ND3#100 You will understand the stuff. Please help. Thanks in advance. I would like to show some stuff which I implemented as per your suggestion. The files are attached. If possible, please have a quick scan diwise.babylon.artifacts_explorer.max..js diwise.babylon.host.max.js Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted October 5, 2018 Author Share Posted October 5, 2018 retained/Hi @brianzinn and @trevordev I somehow solved the issue. A final thing I need to do is, when I do container.removeAllFromScene and container.addAllToScene, the cameras and lights should be maintained properly. But it is not happening. How can I achieve that? Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted October 5, 2018 Author Share Posted October 5, 2018 On 10/3/2018 at 10:35 PM, brianzinn said: I would not use a cylinder panel like you were, because it's too difficult to position when you are close to a wall. I would go with how the WinMR works and pop up a flat panel in front of the user, but away from walls/ground. My preferences I don't want to affect your design - I am not a good designer just pointing out what may be easier. Every unit is 1 meter in VR. Use that as a baseline everywhere. Toggling scenes in VR mode - use asset container: https://doc.babylonjs.com/how_to/how_to_use_assetcontainer Hi, I have modified the PG https://www.babylonjs-playground.com/#JA1ND3#101 Please notice that when the when we switch to flat2009, it is hanging or coming out of VR. I am facing exactly the same issue On 10/3/2018 at 10:35 PM, brianzinn said: Quote Link to comment Share on other sites More sharing options...
trevordev Posted October 5, 2018 Share Posted October 5, 2018 @oschakravarthi What device are you using? When on desktop with WMR acer hmd this looks to work. Do you see any error in the console? Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted October 5, 2018 Author Share Posted October 5, 2018 I have oculus go, cardboard and a laptop (with inbuilt gyroscope). It is not working with any of them. I am not getting any error on console but it is coming out of VR mode Quote Link to comment Share on other sites More sharing options...
trevordev Posted October 5, 2018 Share Posted October 5, 2018 If you just load that scene do you see the same issue? I just tried on a laptop with gyro and could not reproduce this issue. Potentially the scene is too large and causing a driver/memory issue on lower end devices? Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted October 6, 2018 Author Share Posted October 6, 2018 On 10/4/2018 at 1:00 AM, brianzinn said: OK, you may want to look at grid container, if you go with 2D panel: https://doc.babylonjs.com/how_to/gui#grid Hi @brianzinn and @trevordev I switched to BABYLON.GUI.Grid and I have added few buttons and added click event handlers to them. These buttons became non-clickable. No ray is going from my controller. How can I make it work? Even I need to define ray selection and mesh selection predicates to pick these buttons. How can I do that?. Can I get access to the mesh used for each button? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
trevordev Posted October 8, 2018 Share Posted October 8, 2018 Please share your playground and i can take another look. 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.