Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starfield Screensaver Equations

Tags:

c#

math

vector

xna

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

Right now, I can generate random particles ("stars") inside in a certain radius. What I've having trouble doing is figuring out the best way the achieve the affected seen in the afore-linked video.

Question: Given that I have the 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 across the screen in a way which closely resembles that which is seen in the old screensaver?

Thanks!

like image 425
Christopher Logel Avatar asked May 09 '11 21:05

Christopher Logel


1 Answers

They seem to move away from the center. You could 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 outside the screen.

like image 54
Spoike Avatar answered Oct 11 '22 09:10

Spoike