This script simulates attraction and repulsion using Newton’s laws of motion and gravity to deconstruct particle-occupied space.

This code is largely based on forces. Gravitational force is considered attractive, as it consistently attempts to pull two or more masses together: the sun and the planets, the earth and the moon, or fauna to the earth’s surface. Here, the mouse acts as the attracting force, while the particles flock towards it. The force of gravity is given by parameters which include the gravitational constant, ‘mass’ of our particle objects, and the specified distance kept between two objects. The distance keeps particles from colliding into one another.

Forces are also dependent on acceleration of the mass, or particle, and acceleration is calculated using distance traveled over time. While the script is running, particles increase acceleration as their travel path increases.

Particle paths are recorded in three dimensional space with a tail that draws their traveled route, and a planar fill is added. The result is multiple intersections of three dimensional spaces that are defined by the are fluid, impulsive movements of the user. The particle drawing does not convey a sense of mass or weight: instead it suggests an architectural form of spatial relationships. The resulting planes, folds, and spatial envelopes can be extruded into volumes and massing to form an occupiable space.

The script uses one slider function and one toggle: the slider change the background tone using a range of 0-255, while the button pauses the script and leaves the background screen empty of particles and recorded paths.