Jump to content


ScrollSmoother & Threejs

Moderator Tag
Go to solution Solved by akapowl,

Recommended Posts



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.



Thank you!


Link to comment
Share on other sites

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

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

  • Solution


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.



See the Pen wvjyreq by akapowl (@akapowl) on CodePen


  • Like 2
Link to comment
Share on other sites

@akapowl Thank you! 
self.scrollTop()was exactly what I was looking for.

I didnt understand that from the documentation. 

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.