Starfield Screensaver Equations

For those of you who don’t remember exactly what the old Starfield screensavers looked like, here’s a video on YouTube: http://www.youtube.com/watch?v=r5AoFiVs2ME

Right now I can generate random particles ("stars") inside within a specific radius. The fact that I am having problems is to find the best way to ensure that the affected person is seen in the above video.

Question: Given that I have coordinates (vectors) for my randomly generated particles. What is the best way and / or equation to give them a direction (vector) so that they move around the screen in a way that is very similar to what is seen on the old screen saver?

Thanks!

+7
source share
2 answers

They seem to have moved away from the center. Could you try to calculate the vector from the center point of the screen to the generated particle position? Then use the same direction to move the particle and accelerate the particle until it is off the screen.

+3
source

The basic algorithm for working with:

  • Generate stars in a random place, with a 3-dimensional Gaussian distribution (in the middle of the screen, most likely less likely when you leave the screen). Please note that the star’s motion vector is determined by this starting point ... the movement will effectively move outward along the line formed by the starting point and starting location.

  • Assign each newly-formed star to a distance. Please note that the distance does not depend on the original location.

  • Move the star in a straight line with an exponentially increasing speed, while decreasing its distance. You will have to configure these settings yourself.

  • The star should disappear when it passes the border of the screen, regardless of speed.

+4
source

All Articles