react-three-next icon indicating copy to clipboard operation
react-three-next copied to clipboard

How to use ScrollControls

Open clearly-outsane opened this issue 3 years ago • 5 comments

The DOM is outside the Canvas so I can't wrap it in ScrollControls. I'm not sure how to handle scrolling for the canvas and DOM otherwise? Do I just pass a scroll progress value to the canvas and update the camera as I scroll through the page?

clearly-outsane avatar Mar 21 '22 12:03 clearly-outsane

Any thoughts whatsover? I'm curious to know if this is a valid question

clearly-outsane avatar Mar 31 '22 11:03 clearly-outsane

You don't have to use DOM elements outside the Canvas. Just use ScrollControls with <Scroll html>…</Scroll>

eriksachse avatar Apr 02 '22 07:04 eriksachse

Oh it's that simple huh- I thought you HAVE to use it outside or else something won't work as good.

Edit - This works for now I guess, still dunno if it's the best way to do things?. Thanks for the reply! <3

clearly-outsane avatar Apr 03 '22 18:04 clearly-outsane

Yeah there are different ways of displaying text inside the scene. There is Troika, drei/Html, drei/ScrollControls, and of course the good old png.

eriksachse avatar Apr 04 '22 07:04 eriksachse

Is it better to import and use ScrollControls in the _app.jsx, page.js or the canvas/component.jsx itself?

gavan1 avatar Jun 30 '22 08:06 gavan1