Display orientation cube as HUD

I want to display a gadget to indicate the user’s orientation. This one is on the upper layer of the screen and always in the same place as for a hud or a minimap. The idea is to know where is the high, the low, etc.

For now, I managed to put a colored cube on the utility layer. Each time I render, I position it in front of the camera. This camera is an ArcRotateCamera, but I would like it to work with UniversalCamera too.

I think I do not fully understand the pipeline because when I turn around the tube the colored cube moves too.

Are there examples to create a hud with 3D elements that follow the orientation of the camera?

My test playground

A 3d world is rendered through a camera. If you rotate your camera left, the whole world moves/rotates right.

I think you might want to render it
a) on a separate canvas.
b) use a static camera and then update your cube’s rotation based on the main scene’s camera rotation.

Thank you for the answer.
I thought that positionning the cube at each frame relative to the camera was enough.
Indeed, I need two cameras.

I found a playground that reflect what I want: example