oschakravarthi Posted October 2, 2018 Share Posted October 2, 2018 Hi Gurus, I have a single BABYLON.GUI.SpherePanel in my application. In VR mode, the user teleports here and there. When the user clicks on a mesh, I want the panel to appear in front of him (camera?) (The panel might be somewhere else but not it should appear in front of his camera). I have been struggling day and night to achieve this. Please help me. It would even be great if everything else in the scene is hidden except this panel until the user selects a button from the panel. (like a model window) Thanks in advance. Quote Link to comment Share on other sites More sharing options...
trevordev Posted October 2, 2018 Share Posted October 2, 2018 Can you share a playground of what you have right now? If I get it right, you are just missing a function to position something in front of the camera? This could work very similar to how the plane is positioned in this PG: https://www.babylonjs-playground.com/#Q1VRX3#12 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted October 2, 2018 Share Posted October 2, 2018 Here is one way to move something in front of a camera: http://playground.babylonjs.com/#7M7BYY Whenever you click on the canvas, the sphere will be in front of you. If you are using the VR Experience Helper then you need to use the active camera from the helper. Also, if you are using the "anchor" from the other PG then you will want to make sure that you get the rotation right and you can rotate the anchor, which is in the middle of the CylinderPanel (hint: cylinder panel has a radius). Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted October 2, 2018 Author Share Posted October 2, 2018 Hi @trevordev and @brianzinn, Thanks for responding. I have created a PG for this. http://www.babylonjs-playground.com/#MPJ8Y6#4 Please guide me. Thanks in advance Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted October 2, 2018 Author Share Posted October 2, 2018 Hi @trevordev and @brianzinn, Thanks for responding. I have created a PG for this. http://www.babylonjs-playground.com/#MPJ8Y6#4 Please guide me. Thanks in advance Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted October 2, 2018 Author Share Posted October 2, 2018 Hi @trevordev and @brianzinn, To highlight the core problem, I have created a simplified version in PG. http://www.babylonjs-playground.com/#6V9NM1 Please have a look at it. Quote Link to comment Share on other sites More sharing options...
trevordev Posted October 3, 2018 Share Posted October 3, 2018 It looks like your gui is not visible, I created a sphere and move its position to be in front of the head, give this a shot http://www.babylonjs-playground.com/#6V9NM1#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 @trevordev I have modified it to add buttons to the panel. http://www.babylonjs-playground.com/#6V9NM1#2 Please open the link. After the scene is loaded, pls click on the floor mesh. The panel is NOT shown in front of the camera. Now press the down arrow on your keyboard for a couple of times to zoomout the scene in the browser. you see the panel hanging outside. The screenshot is attached. Please look at it. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 3, 2018 Share Posted October 3, 2018 Ping @trevordev Quote Link to comment Share on other sites More sharing options...
trevordev Posted October 3, 2018 Share Posted October 3, 2018 This should position it correctly: http://www.babylonjs-playground.com/#6V9NM1#3 All the docs for scaling/positioning the gui is here: https://doc.babylonjs.com/how_to/gui3d#controls Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted October 28, 2018 Author Share Posted October 28, 2018 Hi, how to mark a question as Solved? My question is very well answered and the problem is solved. Can you please mark it as solved ? 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.