How to build a HUD in a single scene with a single camera?

You add your object3Ds to you camera instead of adding to the scene. That way they are always in the same position reference the camera position and rotation, no matter which way your camera is facing.
eg
camera.add(yourobject3d);
instead of
scene.add(yourobject3d);

It’s the technique I used here,


and is still claimed to be impossible to achieve here

Set you object to be offset slightly on the z axis so that it is not placed at the same position as your camera and then culled by the camera frustum.

By default, the text and graph in my example is always in the centre of your vision unless you set its offsets.
Also, my example is a WebVR library I created many years ago, seems to only work in firefox, but the screen grabs should hopefully get the point across.
image

1 Like