/ Vector graphic animation with JavaScript

Starfield screenshotSo my starfield* has evolved a little. I improved the math that I was using to plot the stars and I added the following improvements:

  • Shape support! Any shape you want can be passed via an array of JSON vector coordinate objects
  • Independent X and Y sine wave applied to star motion
  • Depth shading for added realism
  • Ability to hide shameless plug message :-)
  • Ability to stop/start the animation
  • Plus a bunch of other params I haven’t exposed yet through the UI

Am I taking myself too seriously? Yeah, maybe a little, but I find this kind of thing fun and who knows, it could eventually prove useful. But don’t let me get ahead of myself. For now, playing with stars is fun.

Oh, and don’t knock the buttons code in the page, I just threw those in there real quick to be able to give control over the starfield object. I didn’t feel like going nuts with the code’s cleanliness (that’s in the actual canvas.js file ;)

*This demo requires Safari or Firefox 1.5+ to work.


Read more from the archive.