benjamminf / warpjs

Warp, distort, bend, twist and smudge your SVG’s directly in the browser
https://benjamminf.github.io/warpjs
MIT License
486 stars 34 forks source link

Lookahead dynamic interpolation #4

Closed benjamminf closed 7 years ago

benjamminf commented 8 years ago

At the moment, if set to dynamic interpolation mode, interpolation is done after the algorithm is applied. This is fine, however it's generally only works when the algorithm change is small, like animating or smudging the points. If there is a large difference in position with points before and after applying the algorithm, then the high level of detail is already lost before interpolation can happen, which entirely defeats the purpose of this library.

If there could be some way of temporarily applying the algorithm step, so that point differences can be checked to see what points need to be interpolated (and how recursively far they need to be) then interpolation can happen before the algorithm, thus fixing the trend towards low fidelity when immediate changes are greater.

This would require a bit of re-architecting of the framework.