Рет қаралды 653
Yesterday I came across the Kochawave, a variant of the Koch snowflake. I started playing with the shape in my simple linear IFS setup, and I soon came up with a simple way to parametrize the IFS by the vertices of the generating curve. The results didn't look very nice, though. I wanted to draw the curve in a single line using GL_LINE_STRIP, and it needed a different approach from my usual IFS setup.
Fortunately, I'd used the line_strip approach before with the Hilbert curve, which defines a mapping from the number line to 2D coordinates. The idea was quite readily adapted to a general fractal curve, and the parametrization from the vertices of the base curve turned out even simpler.
Of course, the iterations are done on the GPU, here using a vertex shader. I also thought about a CPU-based approach in Numpy, but crunching a large number of points in parallel is much nicer on a GPU; with 4 segments and 10 iterations, there are 4^10 or about 1 million final vertices. It also avoids moving the points to the GPU again for every frame. So this runs very smoothly in realtime even on an old integrated Intel GPU.
So while this looks pretty basic - something like the course exercises that got me started back in 2015 - the techniques are new to me, and I hope to find more artistic uses for them in the future.
#kochawave #kochcurve #kochsnowflake #fractalcurve #iteratedfunctionsystem #lineart #linedrawing #singlelinedrawing #pythoncode #opengl #algorithmicart #algorist #mathart #laskutaide #computerart #ittaide #kuavataide #iterati