Jump to content
Search Community

Is it possible to do this in greensock?

thepooltable test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hello, I want to know are there ways to do something similar to this (url below), i wish to use greensock as it need to be on touch device.

http://subprotocol.com/system/tree.html

 

Things i want to mimic is dragging the "green leaves" which will also pull the rest(other leaves and branches) along with it, the branches have this pull effect.

- if yes, then where should i look at.

- if no, can you suggest where else can i look at, definitely not verletjs.

 

and then when u release, the "greens" bounce back to where it is (which i think can be done like https://greensock.com/draggable)

 

thank you!

Link to comment
Share on other sites

Hi @thepooltable,

 

Welcome to the forums!

 

The answer to your question is: It is possible.

 

But I have a question for you: why would you want to re-write all of that logic yourself instead of adapting that code to take in touch events?

 

Also why you say 'definitely not verletjs'? That is the first place you should look if you want to replicate what it is doing. The code is public in GitHub, it's just a matter of going over it and locating the logic that creates and handles the IK (inverse kinematics) system.

  • Like 2
Link to comment
Share on other sites

Hi the pooltable,

 

Draggable will certainly help in making each leaf draggable, but there is a whole world of other calculations you will have to code on your own to handle every other leaf and branch updating its position based on the velocity of your drag, the resistance you want to apply, bounce back, etc. 

 

I'm in large agreement with Dipscom in that Draggable can be a piece of the puzzle but you are probably better off studying (and using) the code of examples that are out there that already do 90% of what you need.

  • Like 3
Link to comment
Share on other sites

Thanks for the replies, really appreciate this.

 

First of all, why not verletjs, the effort to use verletjs seems to be alot more then greensock (adding touch, adding calculations on point to add on point, and doing something i've never touch before), and i'm not too sure what's the time frame i can afford to use verletjs.

 

should greensock have the "every leaves drag along" motion, then it will be a breeze, as what i need to do was a very simple interaction. which is why i dont want to invest too much time on this.

 

And i believe i've found another way for my problem, thanks a bunch!

 

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