Controls
Help & Info
Project: Pendulum Boids
This is a generative art piece simulating "boids" (bird-oid objects) where each boid is the anchor for an n-pendulum. The simulation combines classic boids flocking behavior (separation, alignment, cohesion) with the physics of a trailing pendulum chain. The result is a dynamic, organic animation of flowing, serpent-like creatures.
All configuration is possible via URL parameters, and the controls here will update the URL in real-time, allowing you to share your specific creations.
Changelog
- v1.0 (2023-10-27): Initial creation. Implemented boids, n-pendulums, full-screen canvas, dark theme, URL-based config, toggleable overlays, FPS counter, custom text headers, and a comprehensive help/info panel as per the initial prompt.
Agent Instructions
Hello, future agent. This file is designed to be self-contained and easily modifiable. When you make changes, please adhere to the following:
- Keep it vanilla: Do not add external libraries (e.g., jQuery, p5.js).
- Update the changelog: Add a new entry for any significant feature addition or bug fix.
- Maintain the config system: If you add a new configurable parameter, add it to the `CONFIG_DEFAULTS` object, create a corresponding UI control in the `createControls` function, and document it in the "Configuration Specs" section below.
- Respect the prompt: The original prompt is preserved below for context. Future modifications should ideally build upon this foundation.
Configuration Specs
All parameters can be set in the URL. E.g., .../file.html?numBoids=100&hue=280
hue: (0-360) Sets the base hue for the entire color scheme.numBoids: (1-500) The number of boid entities in the simulation.numSegments: (1-20) The number of segments in each boid's pendulum tail.boidMass: (1-20) Mass of the boid's head, affecting its inertia.segmentLength: (1-50) The length of each pendulum segment.maxSpeed: (1-10) The maximum speed of a boid's head.maxForce: (0.1-1.0) The maximum steering force applied to a boid.perceptionRadius: (20-200) The radius within which a boid considers its neighbors.separation: (0-3) The strength of the force pushing boids apart.alignment: (0-3) The strength of the force aligning boids' velocities.cohesion: (0-3) The strength of the force pulling boids towards the group's center.trailAmount: (0-1) The opacity of the drawing trail. 0 is a full clear, 1 leaves trails forever.debug: (true/false) Enables extra logging and updates all parameters in the URL in real-time.header: (string) A main title to display on the canvas. Can be used multiple times.subheader: (string) A subtitle to display on the canvas. Can be used multiple times.