Skip to content

Reset camera position from outside scene #1307

Answered by drcmda
maxwellhankner asked this question in Q&A
Discussion options

You must be logged in to vote

You're thinking bottom up, that's why it seems so complicated to you. React is fundamentally top down, there's state, then components react to it. Put the state that would define the camera position into your state model (zustand, valtio, or even just plain useState). Make the button set it, make a component within canvas listen and react to it.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@maxwellhankner
Comment options

@drcmda
Comment options

@maxwellhankner
Comment options

@maxwellhankner
Comment options

@drcmda
Comment options

Answer selected by maxwellhankner
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