Replies: 1 comment 2 replies
-
This is not a lenis specific question. And you've also answered your own question within your question: you have to write a function that maps the scroll progress to the objects position. I'm not going to provide you with a full solution but something that might help you get on the path is:
This is the exact approach I used for one of my projects: https://joinercad.com/ (the scrollytelling section in the homepage). |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm a bit stuck on this. I have some objects in my Three.js scene.
When clicked, I'd like to use the scrollTo function to move to them, via the camera. I think this is the only API available. I'm currently using the progress value from lenis.on({progress}) to move my camera like so (the camera moves in a corkscrew):
I can get the window cordinates of an object, with something like this:
Course, I can't just plug the y into lenis.scrollTo(), the camera will jump deep into the scene. So how can I map object positions to the scroller?
Beta Was this translation helpful? Give feedback.
All reactions