public class RedRibbon { float noiseScale=0.01; float noiseSpeed = 0.6; float noiseStep = 0; int history = 600; int blobSize = 1000; float ribbonWidth = 2; int ribbonCurrentLength = 0; int historyPos = 0; int lastHistoryPos = 0; int historyReadPos = 0; float [] posHistoryX = new float[history]; float [] posHistoryY = new float[history]; float [] posHistoryZ = new float[history]; float noiseValX, noiseValY, noiseValZ; void calculateRibbon() { // Get Next Position noiseValX = noise((noiseStep)*noiseScale)-.5; noiseValY = noise((noiseStep)*noiseScale,(noiseStep)*noiseScale)-.5; noiseValZ = noise((noiseStep)*noiseScale,(noiseStep)*noiseScale,(noiseStep)*noiseScale)-.5; noiseStep = noiseStep + noiseSpeed; // Poulate Position History posHistoryX[historyPos] = noiseValX; posHistoryY[historyPos] = noiseValY; posHistoryZ[historyPos] = noiseValZ; lastHistoryPos = historyPos; historyPos++; if (historyPos>history-1) historyPos = 0; } void renderRibbon() { // Draw Pos History historyReadPos = historyPos-1; // texture(glowLine); if (frameCount < history) { if (historyReadPos<0) historyReadPos = historyPos-1; ribbonCurrentLength = historyPos-1; } else { if (historyReadPos<0) historyReadPos = history-1; ribbonCurrentLength = history-1; } beginShape(QUAD_STRIP); for (int i=0; i