2

I am trying to write a spaceship simulator. One problem I've hit into is how to best simulate the background of space with its stars. I don't need it to be faithful to the real thing with constellations and everything, but my attempt of uniformly distributing random points on the celestial sphere produced... unnatural-looking starry backgrounds, for reasons I can't put a finger on.

Is there a way to "realistically" distribute random "stars" in space? I'm language agnostic, so feel free to code in the language you're most comfortable with; I'll adjust. :)

  • IS taking the real star position data and pojecting it on your map considered realistic enough? – joojaa Aug 16 '16 at 12:51
  • 1
    You can find data here: http://www.astronexus.com/hyg – joojaa Aug 16 '16 at 12:57
  • Maybe calculate random 3D positions for the stars and then project them onto a sphere. Their brightness depends on the distance from the sphere center. – tmlen Aug 16 '16 at 19:06
  • 4
    Maybe you could add a screenshot of your current results versus what you're looking for (e.g. a photo of a real starry sky that you'd like to imitate)? Otherwise, we're just guessing what "unnatural-looking" means here. – Nathan Reed Aug 16 '16 at 19:52
  • Maybe you could look into poisson sampling, you can define some density function and transform that into distributed points of fairly convincing random distribution. Check here http://devmag.org.za/2009/05/03/poisson-disk-sampling/ – PaulHK Aug 18 '16 at 06:07
  • Is the starfield to be a fixed background? That is, do your spaceships move slowly enough that the stars do not need to move? – trichoplax is on Codidact now Aug 20 '16 at 13:00

0 Answers0