Jump to content

BABYLON.GUI.CylinderPanel() positioning


oschakravarthi
 Share

Recommended Posts

Hi,

 

Thank you all for your support. I am progressing well with my POC.

I am stuck on a problem.

On a click on a mesh, I am populating few buttons into CylinderPanel. The panel is being displayed somewhere else. not even in the viewport.

This panel should be shown to the user in front of the camera so that user can click on any of the buttons.

How can I bring the panel in front of the camera (or make it appear in the viewport).

 

Thanks in advance.

Link to comment
Share on other sites

The easiest way I know is to use an anchor and then move the anchor.

let anchor = new BABYLON.TransformNode("") // this can be a mesh, too
anchor.position = new BABYLON.Vector3(0, 0, 0); // or whereeverr
cylinderPanel.linkToTransformNode(anchor)

To bring in front of the camera, you can use the camera position and facing direction (getForwardRay()), but I imagine you have a set place in the scene.

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