Jump to content
Search Community

Using Draggable Plugin for Horizontal Scroll on WebGL Image Gallery

Shaban Iddrisu™ test
Moderator Tag

Recommended Posts

Hello People!


I hope you are doing well.

I have been working on this project using Three.js to render WebGl images, in other words, merging HTML with WebGL.
The effect is pretty simple and I have successfully hooked it to window.scrollX to achieve horizontal scroll.

Now the challenge is, I am not able to hook this to GSAP's Draggable Plugin to achieve the same however by dragging.

I would be very grateful if anyone can help me out thoroughly.

Thank you!

See the Pen ExZGXvp?editors=0010 by shaban-iddrisu (@shaban-iddrisu) on CodePen

Link to comment
Share on other sites

Hey @Shaban Iddrisu™

 

Love seeing shaders!!!

 

Are you planning on replacing the horizontal scroll with draggable? I ask this because not everyone can scroll horizontally, i.e. people who use a mouse. 

 

Technically you can scroll horizontally by holding the shift button while scrolling with the mouse wheel, but most people don't know that.

 

 

 

  • Like 1
Link to comment
Share on other sites

Cool! I'll update your pen in a few. 

 

While you're waiting, here is the strategy I use for stuff like that. I use a "hidden" proxy element for the draggable, then apply the changes from that proxy element to something else, like a WebGL animation.

 

Just an example. Uses are very old version of Angular.

 

See the Pen 5f0a77404087e565567cfb3870f0c2b6 by osublake (@osublake) on CodePen

 

 

 

 

  • 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.
×
×
  • Create New...