Lab ·
Sketching with maths
A Lorenz attractor and a pair of 3D knots, sketched in p5.js and WebGL in early 2019.
In early 2019 I was playing with p5.js and WebGL, mostly turning maths I'd seen in Daniel Shiffman's videos into sketches. Three of them ended up on Instagram. Here they are together.
The butterfly
The Lorenz attractor comes from Edward Lorenz, a meteorologist who was modelling the weather. Nudge the starting point by a hair and the path ends up somewhere completely different. That's the butterfly effect. The rules are fully deterministic, and the line still never retraces itself.
The first sketch plots the attractor and increases the line width as more points are added. Out came something I hadn't planned: a glowing, spiky flower. Sweet!
There's a fault in the demo somewhere, if you let it run for a while the fps goes down to 10 😶.
Demo: Lorenz Attractor Github: JoostKiens/lorenz-attractor
Why knot?
Next I found Paul Bourke's 3D knots. A knot is just a formula that takes an angle and returns a point in 3D. Sample it, connect the dots, rotate the result.
Then I iterated: added noise, tweaked the magic numbers until it looked good, and added sound. Turn the volume up for this one.