/** * Soft Body * by Ira Greenberg. * * Softbody dynamics simulation using curveVertex() and curveTightness(). */ // center point float centerX = 0, centerY = 0; float radius = 45, rotAngle = -90; float accelX, accelY; float springing = .0009, damping = .98; //corner nodes int nodes = 5; float nodeStartX[] = new float[nodes]; float nodeStartY[] = new float[nodes]; float[]nodeX = new float[nodes]; float[]nodeY = new float[nodes]; float[]angle = new float[nodes]; float[]frequency = new float[nodes]; // soft-body dynamics float organicConstant = 1; void setup() { size(640, 360); //center shape in window centerX = width/2; centerY = height/2; // iniitalize frequencies for corner nodes for (int i=0; i