2

I'm developing a game with THREEjs and webvr-boilerplate. I'm struggling a bit with how to properly render a HUD (score, distance, powerups etc) that always stays at the top of the scene. I've tried to have a plane (with a texture that's brought in from a hidden canvas element) but positioning it in space proves difficult since I can't match the right depth.

Any clues please? :)

pocorschi
  • 3,605
  • 5
  • 26
  • 35

2 Answers2

1

Well, you shouldn't have a classic HUD, VR doesn't work like that.

You're searching for something called diegetic or spatial UI - that is the scores and other icons are rendered as geometry in scene space in a fixed position or distance (this one is called spatial UI). For best results, draw the information on some game object mimicking real displays, for example a fuel gauge on the dashboard of a car or visible remaining bullets on a gun (this one is called diegetic UI).

Unity has made a nice page describing these concepts.

Krzysztof Bociurko
  • 4,575
  • 2
  • 26
  • 44
0

I created a performance statistics HUD specifically for WebVR & THREE.js Projects. https://github.com/Sean-Bradley/StatsVR

While the default setup shows specific information, you can modify it to show custom graphics and other data.

And if you don't believe me, just check out the StatVR video tutorial. StatsVR Tutorial for WebVR and ThreeJS projects

Sean Bradley
  • 3,254
  • 1
  • 17
  • 10