[EDIT:
web demo http://hexara.com/Starfield
runnable jar with source code http://hexara.com/Starfield/StarfieldTest.jar
posted 8/10/12
Original post is below]
A while back dario3004 included a beautiful photo of a starry sky in a post. I recall asking him at the time if it was a graphic or procedural, and he said it was a NASA photo. But that got me itching to see if I could do something similar procedurally. The inspiring post is below:
So, I recently (finally!) started to figure out how to use Simplex Noise, and went back to the idea of making a procedural starry sky. Here is a screen shot:
http://hexara.com/Images/StarrySky.JPG
Was kind of proud of it and wanted to show it off, even if the use of the Simplex noise was really basic (just used the main formula and only two “octaves”). Just the little splash seems to add a lot in terms of making this look like a plausible NASA photograph.
I’m happy to make the java code available. Maybe someone wants to have some night sky? But I wanted to find out if there was any interest first, before putting a lot of time into it. Same thing with adding to the api. Right now it is really simple:
Constructor: give it the rectangular bounds, the number of stars and a seed for the random function.
There are also two methods:
void update()
void draw(Graphics2D g2)
These can go in a game loop to add animation: the stars twinkle, and occasionally there is a shooting star.
Please let me know if there is any interest.
Suggestions for gnarly nebulae creation gladly accepted!