ANIME.js dropping exponents for really small values
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 4.4k
- PR merge metrics
- No merged PRs in 30d
Description
Description:
The version of anime.js that is included has a serious issue when it comes to values really close to zero, and this shows up very often when animating three.js vectors.
Basically, if a numeric value has an exponent, the exponent is ignored. And something like 2.03e-7 will be interpreted as 2.03 causing HUGE random bounces in the animation.
This was fixed in upstream ANIME.js, and is available in 3.1.0 of animejs (and not super-animejs). https://github.com/juliangarnier/anime/issues/551
- A-Frame Version: 0.9.2
- Platform / Device: Not applicable
- Reproducible Code Snippet or URL: https://glitch.com/~purple-soapwort
The glitch example is a little convoluted, but I have a similar use case where the issue shows up (constant updates for an object position that need to be done smoothly). If you run just one animation you will never see the issue. But if you start a new animation while the y-value of the vector is close enough to zero that it has an exponent, ANIME.js will read that value without the exponent, causing the first frame of the animation to jump up drastically.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the bundled anime.js dependency and compare it with animejs 3.1.0, then reproduce the issue using the linked Glitch example and a three.js vector near zero. Done means exponent-form numeric values retain their exponent and starting a new animation no longer causes a large first-frame jump.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, three.js
- Domain
- computer-graphics, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100