From 9d2cb2303c05501f648c0d668e9488c9acaa6d83 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Wed, 12 Feb 2020 23:34:56 +0100 Subject: [PATCH] Tweak shapes for more softness --- voicegardens/static/voicegardens.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/voicegardens/static/voicegardens.js b/voicegardens/static/voicegardens.js index 1c1f563..5a6e285 100644 --- a/voicegardens/static/voicegardens.js +++ b/voicegardens/static/voicegardens.js @@ -215,7 +215,7 @@ class GeneratedShape { this.accelY = 0.0; // The speed at which the shape 'springs' towards its final destination. - this.springing = random(0.0003, 0.0008); + this.springing = random(0.0006, 0.0009); // The speed at which the shape rocks back and forth when it is in the // process of coming to a halt. @@ -224,7 +224,7 @@ class GeneratedShape { // Value that controls the tightness or looseness of the curves between the // x,y values of the shape. AFAIK, this value can go between -5 and +5. // With +5 we have very sharp curves and edges. - this.organicConstant = random(-5, 5); + this.organicConstant = 1.0; // The x,y values which determine where the shape is currently. These are // required in order to calculate where the shape is currently so that we @@ -303,8 +303,8 @@ class GeneratedShape { // this directly influences the shape of the size alongside the // this.radius shape value - this.randXs[i] = ceil(this.soundDuration * random(-30, 30)); - this.randYs[i] = ceil(this.soundDuration * random(-30, 30)); + this.randXs[i] = this.soundDuration * random(-10, 40); + this.randYs[i] = this.soundDuration * random(-10, 40); } for (let i = 0; i < this.edges; i++) { @@ -427,6 +427,9 @@ class GeneratedShape { for (let i = 0; i < this.edges; i++) { curveVertex(this.xs[i], this.ys[i]); } + for (let i = 0; i < this.edges - 1; i++) { + curveVertex(this.xs[i], this.ys[i]); + } endShape(CLOSE); }