14islands / r3f-scroll-rig

A react-three-fiber scroll-rig for syncing 3D meshes and DOM elements.
MIT License
720 stars 36 forks source link

useThree viewport doesn't match camera after resize #10

Closed ffdead closed 1 year ago

ffdead commented 1 year ago

Seems like useThree viewport updates before the scroll-rig camera on resize, and can get out of sync.

A temporary workaround is always to recalculate the viewport when using it:

const viewport = useThree((s) => s.viewport).getCurrentViewport()