Make mesh not moving with the camera

Hello,
Is there a way to make a mesh included in a canvas not moving with the camera of this one ?
How to do with three-fiber ?
Thanks.

there are many ways but the most common is something like a heads-up-display, you see it in games often. basically it means you render two scenes on top of one another.

i have a slightly more complex sandbox with a viewcube: Viewcube - CodeSandbox if you remove the setFromRotationMatrix the hud would stand still.

It works great, thanks

just added it to drei, you don’t need to worry about the createPortal stuff no more. if you refresh the demo you see it. all you need to do now:

import { PerspectiveCamera, Hud } from '@react-three/drei'

function App() {
  return (
    <Canvas>
      {/* normal canvas contents here */}
      <Hud>
        <PerspectiveCamera makeDefault position={[0, 0, 10]} />
        {/* heads-up canvas contents here */}
      </Hud>