lerp the Camera LookAt #1256
Unanswered
carmandale
asked this question in
Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using this...
useFrame((state, delta) => { const step = 0.1 state.camera.fov = THREE.MathUtils.lerp(state.camera.fov, zoom ? 10 : 42, step) state.camera.position.lerp(dummy.set(zoom ? 25 : 10, zoom ? 1 : 5, zoom ? 0 : 10), step) state.camera.lookAt(0, 0, 0) state.camera.updateProjectionMatrix() light.current.position.lerp(dummy.set(zoom ? 4 : 0, zoom ? 3 : 8, zoom ? 3 : 5), step) })
from this:
https://codesandbox.io/s/r3f-basic-demo-nsb7f?file=/src/App.js:597-994
and I want to also lerp the lookAt. I can't seem to figure out how to make that work. I thought it would be like the camera.position since that is also a vector3.
can anyone help?
thanks,
Dale
Beta Was this translation helpful? Give feedback.
All reactions