springer icon indicating copy to clipboard operation
springer copied to clipboard

Tension and friction

Open benjaminbarbe opened this issue 5 years ago • 1 comments

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 avatar Oct 28 '20 06:10 benjaminbarbe

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.

benjaminbarbe avatar Oct 28 '20 12:10 benjaminbarbe