3D fractal canopy
HTML-код
- Опубликовано: 3 окт 2024
- It's in the trees! Another test of simple classical fractals.
A while ago, a friend asked me about algorithmic tree art, and I started playing with simple 2D bifurcation canopies. The math is pretty simple, but there's a lot of fine tuning to get the parameters right for a nice result. Still, it doesn't feel very original for me.
The 3D version provided a bit more challenge, because one does not simply iterate render-to-texture in 3D. While iterating the point coordinates is straightforward, keeping all iterates visible wood complicate the setup for something like vertex shaders. But with these 3 branches and 8 iterations, there are about 10k skeleton points, which should be doable in near realtime even in Python.
I then realized the trees have so much detail that moving the IFS parameters continuously really necessary for a nice video. So I didn't bother too much with Numpy optimizations or alternatives.
However, there's a central bit of math I wondered about for a while, and it's also how this demo grew out of last post's fractal curve: the complexity of 3D rotations. For some reason, my rotor approach didn't look right for this, so I turned to regular rotation matrices.
To beef up the skeleton I used my geometry shader tubules. It looks a bit clunky but suffices to get the idea across.
#fractalcanopy #fractaltree #treefractal #treestructure #itsinthetrees #branchingtreeyoungandsweetonly17 #iteratedfunctionsystem #3dgraphics #digitalsculpture #pythoncode #opengl #algorithmicart #algorist #mathart #laskutaide #computerart #ittaide #kuavataide #iterati