Skip to content
Discussion options

You must be logged in to vote

a camera needs aspect ratio, i'd suggest you use drei/perspectivecamera, it is responsive automatically: <PerspectiveCamera makeDefault />

otherwise

  const viewport = useThree(state => state.viewport)
  useLayoutEffect(() => {
    cameraRef.current.aspect = viewport.width / viewport.height
    cameraRef.current.updateProjectionMatrix()
  }, [viewport])

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fogre
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