react-three-fiber

Using your own camera rig

function Camera(props) {
const ref = useRef()
const { setDefaultCamera } = useThree()
// Make the camera known to the system
useEffect(() => void setDefaultCamera(ref.current), [])
// Update it every frame
useFrame(() => ref.current.updateMatrixWorld())
return <perspectiveCamera ref={ref} {...props} />
}
<Canvas>
<Camera position={[0, 0, 10]} />
Edit this page on GitHub