Black Hole Simulation

This is a neat little program that pulls in all objects to a central point and then throws them away in an infinite loop. The object starts out as a very dark blue and lightens until it reaches the middle. Upon ejection the object will turn bright red and quickly move to a dark red the further from the center it is.

I created this a 3D representation of a 2D canvas program I made that basically did the same thing. You can hold down the mouse and move to look around. Zooming also works with the mousewheel. Click the JS tab below to see the code.

See the Pen Gravity by Bryan Jones (@bartuc) on CodePen.

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.