Jump to content
Search Community

Using Draggable Plugin for Horizontal Scroll on WebGL Image Gallery

Shaban Iddrisu™

Recommended Posts

Shaban Iddrisu™
Posted

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.

Posted

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
Shaban Iddrisu™
Posted

Hello @OSUblake

Thank you for the swift response.

Yes, I will like to replace this with Draggable. This way everyone can simple click and drag to enjoy the effect I am trying to achieve.

Thank you very much.

Posted

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
Shaban Iddrisu™
Posted

@OSUblake

Thank you for taking the time to do this for me. 
It was great of you thinking to keep me informed and busy until you update my pin.

Respect!

Shaban Iddrisu™
Posted

Hello @OSUblake

I hope you are well.
This is a courtesy follow up about my petition.
Do you think you will be able to help me find a solution today..?

Thank you!

Posted

Hey, sorry about that. Had some other stuff come up that I needed to finish first, but I'm working on this right now.

Shaban Iddrisu™
Posted

@OSUblake

Thank you very much. I am very grateful.

I will go check it out now and try to understand how you've implemented it.
Thank you once again.

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...