Mozilla Demo Studio

  • Submit a Demo

Falling in Circles

Simulation of 260,000 Trojan asteroids

Built using HTML5, WebGL

  • 732 views
  • 1 comments

More About This Demo From The Author

This demo simulates the effect that the gravitational interaction between the Sun and Jupiter has on about 260,000 asteroids. After it runs for a few minutes, you will begin to see some patterns develop. First, Jupiter will clear out most of the asteroids from its orbit but will leave some inside its orbit and some outside. Second, you will see two pockets of "Trojan" asteroids develop about 60 degrees ahead and behind the planet. These are locations of gravitationally stability where the forces balance out and allow objects to remain in lock-step with Jupiter. Select info icon in the top-left of the screen to learn more.

This simulation of the asteroids is done entirely on your computer's GPU. Normally used for rendering graphics, the GPU is also an extremely powerful vector processor, allowing many calculations to be done in parallel.

Left mouse button - Click and hold to spawn asteroids in a circular orbit around the Sun.

Right mouse button - Click and hold to spawn asteroids with velocity relative to the mouse. Drag the mouse while spawning to affect their starting velocity.

Space bar - Toggle between a Sun and Jupiter perspective. In Jupiter's perspective, the locations of gravitational balance are highlighted.

1 comment so far

Register or log in to add your own.

  1. Erick_Ribeiro said,

    This demo is not working here. I receive the message:
    "Failed to load project
    Did you forget to enable API access on the project?"

Get the Source Code

Download the Source 3644.64 KB · ZIP File

Browse the Source

This demo is released under the Apache license.