This article explains the galaxy generation algorithm showcased in the video
below. It is written in C#, rendered with OpenGL and the source code is
available here
[https://www.dropbox.com/s/sxhgc6dlff1ej1g/galaxyGeneration.cs?dl=0].
At the end of the article you can see how the galaxy is