Home of Ebyan Alvarez-Buylla

Procedural Radial Flowers

Procedural Radial Flowers

At my wife’s request I bring you a direct spin off of the Procedural Space Invaders, only this time rotated along a center axis to create procedural radial spirals, or “flowers”. You can see it in action here and grab the source code from GitHub.

The algorithm works by filling in a square grid of a predetermined size (the one featured above and in the source code is 4×4) with pixels that are either “on” or “off”. This can be done randomly or using binary to encode a sequence from 0 to 2size2, which, for example, on a size 3 spiral results in 29=512 possible combinations:

3x3

And on a size 7 in 249=562,949,953,421,312 possible combinations, calculating and drawing the total of which is sure to crash your browser, so here is a small subset:

7x7

Enjoy!