A standalone, low-level generative art engine that uses chemical rules and NCBI data to create dynamic, scientifically-inspired visual effects.
ChemGen is a C++ based particle engine where particles behave like atoms. They respect valency rules (e.g., Carbon forms 4 bonds), form dynamic covalent bonds based on proximity, and can be influenced by user interaction (mouse cursor).
It bridges "Real Science" and "Generative Art" by fetching real molecular structures from the NCBI PubChem database using Bash scripts, converting them into templates, and then using those templates to spawn "chemical debris" that reassembles procedurally.
Video demo: https://youtu.be/-96aCa3wix4
- Language: C++ (No Python, no heavy frameworks)
- Graphics: SDL2 (Simple DirectMedia Layer) for low-level windowing and rendering.
- Data: Bash + Awk scripts to fetch and parse SDF files from NCBI PubChem.
- Build: G++ / Make.
- Linux (Ubuntu/Debian)
aptpackage managerg++,makelibsdl2-dev,libsdl2-ttf-dev
./install_deps.shDownloads real molecular structures (e.g., Caffeine, Benzene) from NCBI to use as spawn templates.
./scripts/fetch_molecule.sh caffeine
./scripts/fetch_molecule.sh benzene./build.sh./chemgen- Mouse Click: Emits atoms/radicals.
- Enter: Spawns a complex molecule from the fetched templates.
- R or Space: Clear screen.
- ESC: Quit.