Skip to content

Pointer events on HUD elements #1675

Answered by drcmda
MeghaS94 asked this question in Q&A
Sep 22, 2021 · 1 comments · 8 replies
Discussion options

You must be logged in to vote

like this: https://codesandbox.io/s/stoic-breeze-s4ovd?file=/src/App.js

  1. wrong namespace, it's @react-three/fiber
  2. you can get fully functioning orbitcontrols and perspcam from drei, saves you the boilerplate
  3. do not render the HUD scene, or else you double render. you need to portal it into a external scene
  4. the useCamera hook can make the hud aware of camera transforms on the mesh level. unfortunately there is no easy way ootb. its a technical issue, react doesn't tell me we're inside a portal and i cannot know which camera you plan to render with.
  5. it is better to give the HUD full capacity to render, because now it can re-used. the moment it unmounts you're back to plain view without the …

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@MeghaS94
Comment options

@drcmda
Comment options

@MeghaS94
Comment options

@drcmda
Comment options

@MeghaS94
Comment options

Answer selected by MeghaS94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants