Projects with C++: Particle swarm animation using SDL, Conway's Game of Life with pgm images, Mandelbrot-Set Fractal draw on bmp images
The Fractal Drawer draws the Mandelbrot-Set on BMP Images.
The Mandelbrot set is the set of complex numbers c for which the function f(c)=z^2+c does not diverge. On the pictures, that’s the black region inside the shape. It’s at the margins of that shape where it gets interesting: The colors indicate how fast the function goes to infinity given each pixel, representing a point in the complex plane, as input.
Code structure:
Created April 2017
This program uses the Simple DirectMedia Layer (SDL) to create a window where a swarm of particles performs an explosion-like motion with color-change.
Detailed instructions on how to create such a simulation can be found in this free udemy-course. For the setup of SDL, see this tutorial. On my mac, I used Homebrew via brew install sdl2
and compiled with g++ including the SDL-files with g++ explosion.cpp -o explosion -I/usr/local/Cellar/sdl2/2.0.5/include/SDL2 -D_THREAD_SAFE -L/usr/local/lib -lSDL2
).
Code structure:
Created April 2017
This project was part of the C++ lecture ipi and is a simple implementation of Conway’s Game of Life using the image format PGM (Portable Graymap).
Given an initial configuration of pixels, which correspond to “living cells”, the algorithm determines which pixels will be lit in the next iteration. The program outputs a series of pgm-images which can be converted into an animated film using ffmpeg or ImageMagick with the command convert -delay 6 conway_sim_*.pgm simulation.mpg
.
The rules are:
Created March 2017