Another creative fractal design: this time using layered Voronoi patterns:
(show (let [voronoi1 (voronoi :points 32)] (fractal :while (v- 0.97 (voronoi-function (v- 1 (v* (vdivide (v- y x) y) (vdivide (v- z x) z))) :voronoi voronoi1)) :update (v+ (v* pos 2) pos) :result (vdivide 3 (v+ 3 'i)) :max-iterations 4)) 512 512)
Tricks used here:
- Using the :while condition to bailout early if a white area is hit
- Scaling the position vector on each iteration to give the effect of being further away from rear layers – this is the (v+ (v* pos 2) pos) part
- Making the resulting colour darker on each iteration – this is the (vdivide 3 (v+ 3 ‘i)) part which tends towards zero as i increases.