4 ms·
Nice spring stuff, I hadn't seen it written up like that before. I did my own in JS recently (also based on solving the damped spring equation as a 2nd order od
by i_am_ralpht 12y ago
Nice spring stuff, I hadn't seen it written up like that before. I did my own in JS recently (also based on solving the damped spring equation as a 2nd order ode; I copied my solution out of a physics textbook): https://github.com/iamralpht/iamralpht.github.io/blob/master/physics/spring.js https://github.com/iamralpht/iamralpht.github.io/blob/master...
I think the main advantage of using physical models is that you can feed velocity (from a touch gesture) into them. You can't really do that with the Penner equations (you could compute duration based on the derivative at t=0, but it won't feel very nice).
I wrote up some of the advantages of using physical models for UI animations and interactions here: http://iamralpht.github.io/physics/ http://iamralpht.github.io/physics/