We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › starfield, cool algorithm to move stars.
Page Index Toggle Pages: 1
starfield, cool algorithm to move stars. (Read 907 times)
starfield, cool algorithm to move stars.
Apr 13th, 2009, 7:04pm
 
Hi,

to whoever is interested in a really cool algorithm to move the stars in a starfield, found this made by Jim Brown at http://mobile.processing.org/discourse/YaBB.cgi?board=games;action=display;num=1210073922

can anybody give me a hand to understand this algoritym,
in particular the spread number and the z number.

z-=SPEED;
   sx=(x*SPREAD)/(z)+CX;
   sy=(y*SPREAD)/(4+z)+CY;

to see the animation just copy paste this code from Jim into processing, just add the size() window. size(500,500,P3D);

thanks!

http://mobile.processing.org/discourse/YaBB.cgi?board=games;action=display;num=1210073922
Page Index Toggle Pages: 1