Taking my lastest Apollonian gasket code from 2D to 3D was quite straightforward in principle, though there were a few kinks in the road. A particular difference between 2D and 3D gaskets is that in 3D, the inversion spheres overlap, which can create duplicate spheres.

Viewing detailed 3D structures isn't trivial either. We can only really see in 2D, as one dimension is taken up by the ray of light. Looking from outside, I wouldn't guess this blob contains over 10k spheres, so I blew it up for this clip.

The sheer amount of balls is also heavy on the drawing side, so I used my low-poly "sprites" where each ball is drawn by a geometry shader from a single input point. The low-poly aspect is quite clear in the largest spheres, but I think it's OK for this math demo.

#apollonianspheres #apolloniangasket #iteratedfunctionsystem #inversion #sphereinversion #geometricart #3dgraphics #digitalsculpture #pythoncode #opengl #geometryshader #algorithmicart #algorist #mathart #laskutaide #ittaide #kuavataide #iterati

How it was supposed to look like in the first place: rounded with Bezier curves.

I've used Bezier curves and Hermite splines quite a lot to smooth out progressions of discrete points, such as Hamiltonian circuits. The challenge with this Hilbert curve is that there are tens of thousands of points, so drawing a nice OpenGL shape for each edge gets rather slow. Of course, this isn't a deal breaker for still images, but I like making my code efficient.

I've now constructed the Bezier curves in geometry shaders. I've used those for some time to draw simpler shapes more efficiently, such as line segments with rounded ends; the idea is to do more work on the GPU, while moving as little data as possible there. These line segments only need the endpoint coordinates, as well as thickness and colour. The curves seemed more challenging due to the number of parameters, but in the end there weren't really any issues.

#beziercurve #hilbertcurve #planefillingcurve #spacefillingcurve #lineart #linedrawing #singlelinedrawing #pythoncode #opengl #geometryshader #algorithmicart #algorist #mathart #laskutaide #ittaide #kuavataide #iterati

Extruding triangles with a geometry shader😎
.
.
.
#shader #geometryshader #shadertechniques #geometry