React Three Fiber – Smooth Camera.lookAt



This content originally appeared on DEV Community and was authored by Khaled Ali

After trying some solutions including 3rd party libs and more vanilla Three.js ways, I found a clean react-y way to have the camera smoothly look at a given position using React Three Fiber.

Thought I’d share! The Codesandbox has comments describing what I did. Just rip out that hook and use in your code.


This content originally appeared on DEV Community and was authored by Khaled Ali