Jump to content

Bring 3D panel in front of camera.


Recommended Posts

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.


Link to comment
Share on other sites

Here is one way to move something in front of a camera:
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).

Link to comment
Share on other sites

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.


Link to comment
Share on other sites

  • 4 weeks later...

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.

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.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...