tween.js icon indicating copy to clipboard operation
tween.js copied to clipboard

Animation on repeat speeds up over time.

Open trusktr opened this issue 8 years ago • 17 comments

Here's @jonobr1's original, forked to use array values:

https://codepen.io/trusktr/pen/04518ee24a8d1d7822e584c6a513d378?editors=1010

Watch it for a while. Over time, the animation speeds up, which shouldn't happen.

trusktr avatar Sep 17 '17 16:09 trusktr

Do you know what the bug I'm leveraging is?

jonobr1 avatar Sep 17 '17 18:09 jonobr1

@jonobr1 Oops, I meant to post a link to a fork of yours, where the only difference is that I'm passing an array of values to o's rotation, on line 10:

http://jsfiddle.net/18ymqpdw/0/

If you watch it for a while, you'll notice that the animation seems to speed up after a few repeats.

I updated the original post to use the forked link. What bug were you leveraging in yours?

trusktr avatar Sep 17 '17 18:09 trusktr

I'm not too familiar with arrays in Tween.js..., but if that's the difference then I don't think I'm leveraging any bugs in the fiddle I made. Also, this might be an inaccurate use of the API and may not be a bug.

jonobr1 avatar Sep 18 '17 17:09 jonobr1

@trusktr See fiddle using es6-tween, but it has bug also

EDIT: I fixed bug

dalisoft avatar Sep 19 '17 06:09 dalisoft

Interesting, at least that behavior is consistently repeating, rather than changing each time it repeats. Let's see what's going on here..

trusktr avatar Sep 19 '17 08:09 trusktr

@trusktr It is about tween.js or es6-tween. I am added this to es6-tween issue list and i will fix as soon as possible

dalisoft avatar Sep 19 '17 09:09 dalisoft

@trusktr Is in this fiddle issue was fixed?

dalisoft avatar Sep 19 '17 09:09 dalisoft

Looks like the examples broke. I update the OP with a working example on codepen. I'd like to start fixing stuff and moving forward!

trusktr avatar May 30 '20 01:05 trusktr

@dalisoft Mind updating your example?

Also, sidenote, if you don't mind making some PRs to bring your ideas into the main repo, that'd be great!

trusktr avatar May 30 '20 01:05 trusktr

@trusktr I updated, but seems does not work, some incompatibility with two.js

I deprecated es6-tween due of less time to spent, i think these some things can be applied and source code can be got from es6-tween

  • TypeScript (currently es6-tween is ES6, but before have been written TS)
  • DOM Plugins
  • Infinite Deep-Level tweening without loss of performance
  • Events (multiple .on('complete' | 'update', 'start'))

dalisoft avatar May 31 '20 08:05 dalisoft

@dalisoft Thanks! I updated your example with the working version of Two.js: https://codepen.io/trusktr/pen/b10d7a5693b7ba6b9ed70b13e7ab0fb2?editors=1010

I like those ideas. In particular I'm curious about Infinite Deep-Level tweening without loss of performance. I just merged and updated outstanding nested properties pull requests from @Malows and @talltyler. See https://github.com/tweenjs/tween.js/pull/536 and https://github.com/tweenjs/tween.js/pull/366

Interested to learn about the alternative method. I'm thinking perhaps to cache the nested objects to key paths. What'd you do in es6-tween?

trusktr avatar Jun 01 '20 03:06 trusktr

Updated the broken example with newest changes. No luck though: https://codepen.io/trusktr/pen/c258027326d412f81e3aad96d669307c?editors=1010 Need to dig into it...

trusktr avatar Jun 01 '20 03:06 trusktr

@dalisoft In which commit did you fix the bug in es6-tween?

trusktr avatar Jun 01 '20 03:06 trusktr

@trusktr Which bug? I don’t remember, there but more commits, really I don’t have time to checkout all them. Of course, if you mean infinite deep level tweening - it’s not bug, i made it feature from start of planning es6-tween. Most of tweening library still does not support this feature

dalisoft avatar Jun 01 '20 04:06 dalisoft

I meant the bug that the above demo goes faster and faster over time. I'll peruse through es6-tween next.

trusktr avatar Jun 03 '20 00:06 trusktr

I don’t think i can support es6-tween anymore currently and within few month. Of course, it’s off-topic, but did you got my mail message?

dalisoft avatar Jun 03 '20 00:06 dalisoft

Looks like this is still reproducible in v22, and in particular it looks like it happens with the new startFromCurrentValues() method which used to be the default behavior in v16.6:

https://codepen.io/trusktr/pen/oNVBjKG/ff650c9a627e22bb629cdae20b8eaec4?editors=1010

When using the current .start() method in recent tween.js version, the issue is bypassed. This provides a clue: it has to do with starting with current values!

trusktr avatar Jan 15 '24 02:01 trusktr