Physics

Gravity Ball Sandbox (Gravity Well)

Play Gravity Ball Sandbox (Gravity Well), a customizable 3D physics arena. Drag empty space to rotate, move grounded balls accurately near or far, fling airborne balls, plant explosive mines, change gravity and palettes, trigger rain or bursts, and capture PNG or MP4 with sound when supported.

killyourtime.com

Preparing your experience

GRAVITY WELL
DRAG EMPTY SPACE rotate · WHEEL zoom · SPACE burst · G zero-g · R rain · C clear · H hide ui
TOOL
BALLS 000/170
FPS --

What Gravity Ball Sandbox (Gravity Well) lets you build

Gravity Ball Sandbox is a live 3D physics arena for creating, moving, colliding, and destroying groups of balls. It is designed around immediate cause and effect: add one object and watch it fall, throw a ball across the floor, start a continuous rain, remove gravity, or place an explosive mine in the middle of a moving cluster. Every ball has a visible size, mass, velocity, bounce response, and collision boundary, so a small change can alter the whole scene rather than playing a fixed animation.

The arena is a circular contained space with a solid floor, an outer wall, and an overhead containment limit. Balls rebound from the floor and perimeter instead of disappearing off screen. In Zero-G mode the upper boundary becomes especially important because an upward-moving ball can travel through the full height of the chamber before returning. The glowing boundary, floor ripples, impact flashes, shadows, dust, and camera shake make contact easier to read without covering the simulation in labels.

Rotate, zoom, and inspect the arena

Drag an empty part of the 3D canvas to rotate the camera around the fountain-like circular arena. This works in Drop, Grab, and Mine modes, so camera movement does not require a separate navigation tool. The mouse wheel zooms between a close inspection and a wider view of the full boundary. On touch devices, one finger rotates when the gesture begins away from an object, while a two-finger gesture controls zoom and rotation.

The camera begins with gentle automatic rotation so the depth of the scene is visible immediately. The first direct interaction stops that automatic movement and gives the user control. A low side angle is useful for judging bounce height and mine shockwaves, while a higher angle makes clusters, wall collisions, and ground dragging easier to follow. Fullscreen enlarges the actual sandbox element to the whole display rather than merely stretching the surrounding webpage.

Drop balls one at a time

Drop is the default creation tool. Move the pointer over the floor to position the circular placement guide, then tap or click without dragging. A new ball appears above that location with a small amount of random horizontal movement and falls under the current gravity value. Repeating the action in one area builds a pile; distributing clicks around the arena produces several independent collision paths. The simulation keeps a firm maximum of 170 live balls and recycles an older ball when necessary, preventing an experiment from overwhelming the browser.

Ball Size changes the range used for newly created balls rather than resizing every existing object. This allows mixed scenes: create a group of small balls, increase the size control, and add a few heavier bodies afterward. Because mass follows volume, a larger ball carries more inertia during a collision. It can push through a collection of small balls more convincingly than a purely decorative sprite would.

Grab grounded and airborne balls accurately

Grab mode selects an individual ball by raycasting from the pointer into the 3D scene. A ball resting near the floor is locked to a horizontal ground plane while held. That ground-aware mapping prevents the ball from unexpectedly rising when it is moved toward the far side of the arena, and it makes near and distant placement behave consistently. Drag slowly to arrange a row or push a pile; move quickly and release to fling the ball with its accumulated velocity.

An airborne ball uses a camera-facing movement plane instead. It can be repositioned through open space and released with vertical as well as horizontal momentum. While held, the selected ball behaves like a strongly controlled body during collisions, so nearby balls move around it instead of crushing the pointer interaction. Release velocity is capped to keep a fast gesture energetic without allowing numerical instability or launching the ball permanently outside the containment field.

Use collisions, bounce, gravity, and speed together

The Gravity control sets downward acceleration. A high value produces quick drops, compact bounces, and heavier-looking piles. A lower value gives collisions more airtime. Setting gravity above zero automatically leaves Zero-G mode, which avoids two controls silently fighting each other. Bounce controls restitution: low values absorb more impact, while high values preserve more speed after a collision with another ball, the floor, the wall, or the ceiling.

Speed changes the simulation time scale. Slower settings are useful when inspecting a mine detonation or arranging a dense cluster. Faster settings make rain, cascades of collisions, and long rebounds develop more quickly. The engine uses two smaller physics passes per rendered frame to improve contact stability. Drag and resting friction reduce endless sliding, while sphere-to-sphere correction keeps overlapping balls separated.

Plant mines with a destructive center and a wider shockwave

Mine mode places a dark metallic explosive with a faceted core, multiple spikes, crossing bands, and a glowing red fuse. It falls and bounces like a physical object rather than remaining as a flat icon. A nearby ball can trigger it, a hard impact can set it off after its short safety period, and the fuse also detonates automatically. Mines close to another explosion enter a delayed chain reaction, making it possible to arrange several devices and watch the blast move across the arena.

The explosion has two deliberately different zones. Balls closest to the mine are removed as intact spheres and replaced by individual tetrahedral fragments. Those pieces fly away from the center, spin, fall under gravity, bounce briefly on the floor, and fade. Balls farther away remain whole but receive an outward impulse, an extra upward jump, a squash response, and a rapidly decaying vibration. Objects just beyond the main impulse radius can still show a smaller visible shock. This layered response communicates shattering, pressure, and residual vibration instead of applying one identical jump to every object.

Create larger scenes with Burst, Rain, and Zero-G

Burst creates fourteen balls near the center and launches them in a radial pattern with varied upward speed. It is the fastest way to test wall collisions or start a chaotic scene. Rain continuously creates balls high above random points inside the arena until switched off. The live ball cap still applies, so Rain can run without growing memory use forever. Combining Rain with a low bounce value creates a settling bed; using a high bounce value turns the same input into a busy chamber.

Zero-G removes normal downward acceleration and gives existing balls a gentle initial lift. The arena does not become collision-free: objects still strike one another and rebound from the floor, walls, and overhead boundary. This makes Zero-G useful for observing three-dimensional collision paths that would otherwise end quickly in a pile. Restore gravity at any time to let the suspended cluster collapse back toward the floor.

Choose a palette without changing the physics

Candy, Ember, Lagoon, and Black + White affect the colors assigned to newly spawned balls. Candy mixes coral, amber, yellow, green, cyan, violet, and pink. Ember stays in a warmer fire-and-earth range. Lagoon uses aqua, blue, pale cyan, and cool highlights. Black + White is a strict neutral palette containing white, silver, gray, charcoal, and near-black; it does not include a hidden red option. Existing balls retain their original materials when a new palette is selected, allowing two color groups to share one simulation.

Lighting and material response remain three-dimensional in every palette. Each sphere receives environmental reflections, a small emissive contribution, soft shadows, and velocity-sensitive brightness. The color choice is therefore more than a flat fill, but it never changes mass, bounce, or collision rules. A monochrome experiment and a colorful experiment remain physically comparable.

Capture PNG images and MP4 recordings

Download PNG renders the current camera view and saves the WebGL canvas. The page header, article, customization panel, buttons, and status labels are not drawn into the file. The renderer uses an opaque dark clear color so the saved image includes the intended arena background rather than an unexpected transparent region.

Record starts a canvas-only video stream. Press the same control again to stop, finalize, and automatically download the MP4. When the browser supports a compatible MP4 video-and-audio codec, the app mixes its procedural collision, bounce, placement, and explosion effects into the recording through a Web Audio media destination. If audio capture is unavailable, the status message explains that video is still being recorded. Browser codec support determines whether MP4 recording can begin; the tool does not disguise a WebM file with an incorrect extension.

Minimize controls, use shortcuts, and plan experiments

The customization panel contains capture controls, Gravity, Bounce, Speed, Size, and the four palettes. Its minus button moves the complete panel off the stage and leaves a compact Tune button for restoring it. The sound button in the lower toolbar mutes or restores procedural effects without adding background music. Clear removes balls, mines, and active fragments, making it possible to begin a new experiment without reloading the page.

Keyboard shortcuts provide a faster route: 1 selects Drop, 2 selects Grab, 3 selects Mine, Space triggers Burst, G toggles Zero-G, R toggles Rain, C clears the arena, H hides the full interface, and T toggles the customization panel. Useful experiments include comparing the same burst at two bounce values, building a monochrome pile before adding one large colored ball, arranging a mine chain, switching gravity off during Rain, or recording the collapse that follows when gravity returns.

Keyboard shortcuts make quick experiments easier: 1 selects Drop, 2 selects Grab, 3 selects Mine, Space triggers Burst, G toggles zero gravity, R toggles rain, C clears the arena, and H hides the interface. The sound button controls collision and explosion effects; compatible browsers route those effects into MP4 recordings while leaving the surrounding page and controls out of the capture.