4 ms·
Thanks! I know it can be cumbersome to navigate a long history, but people generally love this feature. Because it is easy to loose "the perfect" image while pl
by stankot 7y ago
Thanks! I know it can be cumbersome to navigate a long history, but people generally love this feature. Because it is easy to loose "the perfect" image while playing with controls. This allows you to click back couple of times and find it.
As for how it works, I plan to do a full write up on my blog. But I'll give you a short summary.
- I generate a random vector field (https://en.wikipedia.org/wiki/Vector_field https://en.wikipedia.org/wiki/Vector_field). It is not completely random, I pull them all slightly to the right, as chaos is rarely visually pleasing.
- Then I generate random starting point for each line.
- For each point, I find all vectors in certain radius, and apply their force to the dot. The further away the vector is, the weaker force applies to the point. This will give me next point.
- I repeat the process for the new point, until line is out of bounds or line reaches length of 100 point.
- Now line looks like a array of points (x, y coordinate pairs). Using these points, I draw smooth bezier curve.
That sums it up I think. The whole thing has some random aspects, params controlled by the user and some I tweaked how I like them to give what I think is visually pleasing. Try enabling debug mode and playing with controls.
This codepen is my initial exploration, the code is very similar to the final think and it might be easier to understand.
https://codepen.io/stanko/pen/rNavBvN https://codepen.io/stanko/pen/rNavBvN
EDIT: Formatting.
- achow 7y ago> I know it can be cumbersome to navigate a long history.. Maybe what you can do is use Neon logo (top left) as reset. Clicking on that takes one back to the original state. After playing around a bit, I wanted to start again and clicked on that logo (multiple times) expecting that to wipe the slate clean and I can restart my exploration again.
- stankot 7y agoThat makes sense. For now there is a reset button at the bottom.