Share Posted September 28, 2022 Hello, I have a project with htlm images and I am creating a threejs plane per image and I am placing them using the img's getBoundingClientRect(). This part is working fine but the problem is when I try to have the scrollsmoother on both my html page and my threejs scene, in sync with ScrollSmoother. By offseting the position of my elements by the window.scrollY this is working fine but obvioulsy I dont get the smoothness from ScrollSmoother, and when I am trying to do scrollsmoother.progress * window.scrollY I am expecting to have to correct position but this is not working. This is how I am calculating the position of my mesh. This is my ScrollSmoother instance Here is a preview with an offset with window.scrollY & another with window.scrollY * scrollsmoother.progress. https://drive.google.com/drive/folders/17n9zVM2ROEEFZxx_-1r67aqoory8sdTm?usp=sharing Thank you! Link to comment Share on other sites More sharing options...
Share Posted September 28, 2022 Hi @Akamiaxx and welcome to the GreenSock forums! Can you please provide a simple minimal demo that shows exactly what you're issue is? Is a bit hard to debug or find the problem with what you're describing. Knowing your setup and having a live sample to tinker with would speed the process a lot. Happy Tweening! Link to comment Share on other sites More sharing options...
Author Share Posted September 28, 2022 Sorry I can't create one right now, but I am trying to get the scroll position in pixels from scrollsmoother. Do you have any idea of how I can get that ? Since scrollsmoother doesnt provide that I was thinking about : scrollsmoother.progress * window.scrollY. Any thoughts ? Link to comment Share on other sites More sharing options...
Solution Solution Share Posted September 28, 2022 12 minutes ago, Akamiaxx said: I am trying to get the scroll position in pixels from scrollsmoother. [...] Since scrollsmoother doesnt provide that [...] Hello @Akamiaxx Actually, I think it does provide that.https://greensock.com/docs/v3/Plugins/ScrollSmoother/scrollTop() See the Pen wvjyreq by akapowl (@akapowl) on CodePen 2 Link to comment Share on other sites More sharing options...
Author Share Posted September 28, 2022 @akapowl Thank you! self.scrollTop()was exactly what I was looking for. I didnt understand that from the documentation. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now