Galaxy Generator

Saturday, May 18. 2002

Galaxy Generator

This Python script generates a 3D galaxy from a number of parameters and stores it in an array. You can modify this script to store the data in a database or whatever your purpose is. THIS script uses the data only to generate a PNG with a 2D view from top of the galaxy.

The algorithm used to generate the galaxy is borrowed from Ben Motz The original C source code for DOS (including a 3D viewer) can be downloaded here: http://bits.bristol.ac.uk/motz/tep/galaxy.html

Download: galaxygen.py

Peter Frauenglass at 2010-07-28 23:18
I'm about 8 years late to the party here, but a bit of awesome just happened and I felt it deserved a comment.

I was in the middle of developing a game in python and needed to generate a spiral galaxy. I went searching... and found this little script, exactly what I wanted. It even outputs the data in the formats I need - both list and png! Thanks a bunch for putting this out.

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA