Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tension and friction #1

Open
benjaminbarbe opened this issue Oct 28, 2020 · 1 comment
Open

Tension and friction #1

benjaminbarbe opened this issue Oct 28, 2020 · 1 comment

Comments

@benjaminbarbe
Copy link

Hello,

Thank you very much for your work.

I was wondering if it was possible to convert the tension and wobble with values from the other tools (Android's StringForce, Framer's tension and friction...)

Tension is like stiffness but Wobble is different from damping?

I try to reproduce the same animations with your code.

Thanks

@benjaminbarbe
Copy link
Author

Sorry I wrote too fast :-)

These two lines answer my question:

  const stiffness = Math.min(Math.max(350 * tension, 20), 350)
  const damping = Math.min(Math.max(40 - (40 * wobble), 1), 40)

So I have to do:

const spring = springer(curveOptions.tension / 350, 1 - (curveOptions.friction / 40));

Thank you again for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant