Skip to content

How can i achieve this kinda camera movement? #1544

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

You must be logged in to vote

i dont see any movement, there is a fadeout, the camera snaps into place, then a fade-in.

you could slap a plane in front of the camera and animate opacity https://codesandbox.io/s/color-grading-forked-e3hcw?file=/src/App.js:869-1238 when it reaches 0 you can put the camera somewhere else

function Cover() {
  const { width, height } = useThree((state) => state.viewport)
  return (
    <PerspectiveCamera position={[0, 0, 5]} fov={45} makeDefault>
      <mesh scale={[width * 2, height * 2, 1]} position={[0, 0, -1]}>
        <planeGeometry />
        <meshBasicMaterial color="black" transparent opacity={0.5} />
      </mesh>
    </PerspectiveCamera>
  )
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bhushan6
Comment options

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