Jump to content

[Solved] Options for a HUD overlay on top of a 3D scene


KevinG
 Share

Recommended Posts

I'm working on a 3D interface which will leverage WebVR which means that everything needs to be done inside of a single canvas element.  The interface uses a FreeCamera to move around, but I'd like to also draw a HUD on top of the content.

My current thoughts were that I could draw elements to a second scene, and layer that on top of the 3D scene. Is the second scene even necessary? Is there some way to lock a HUD element in place so it doesn't move when the camera moves? Thanks!

Link to comment
Share on other sites

I personally use a seperate canvas for GUI elements, as I find problems in parenting elements to the camera such as gimble lock and "flipping" if your camera is animated. Creating a seperate "game" canvas has been the best solution for me personally.

DB

Link to comment
Share on other sites

Two canvases can be easier to manage, unfortunately for VR games you can only send a single canvas to the HMD.

Thanks for the tips all, for now ScreenSpaceCanvas2D seems like it might be the best bet. The problem I'm running into now is figuring out how to draw 3d game objects inside of ScreenSpaceCanvas2D so I can re-use game objects inside of menus.

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