diff --git a/trunk/sketch.js b/trunk/sketch.js index be30b49..3347bdd 100644 --- a/trunk/sketch.js +++ b/trunk/sketch.js @@ -1,12 +1,12 @@ let sketch = function(p) { - let rings = 50; - let dim_init = 50; - let dim_delta = 4; + const rings = 50; + const dim_init = 50; + const dim_delta = 4; - let chaos_init = .2; - let chaos_delta = 0.12; - let chaos_mag = 20; + const chaos_init = .2; + const chaos_delta = 0.12; + const chaos_mag = 20; let ox = p.random(10000); let oy = p.random(10000); @@ -19,7 +19,6 @@ let sketch = function(p) { p.smooth(); p.noFill(); //p.noLoop(); - } p.draw = function() { @@ -33,24 +32,18 @@ let sketch = function(p) { oy-=0.02; oz+=0.01; for(let i = 0; i < rings; i ++){ - p.beginShape(); + p.beginShape(); for(let angle = 0; angle < 360; angle++){ - let radian = p.radians(angle); - let radius = (chaos_mag * getNoiseWithTime(radian, chaos_delta * i + chaos_init, oz)) + (dim_delta * i + dim_init); + const radian = p.radians(angle); + const radius = (chaos_mag * getNoiseWithTime(radian, chaos_delta * i + chaos_init, oz)) + (dim_delta * i + dim_init); p.vertex(radius * p.cos(radian), radius * p.sin(radian)); } - p.endShape(p.CLOSE); + p.endShape(p.CLOSE); } } - function getNoise (radian, dim){ - let r = radian % p.TWO_PI; - if(r < 0.0){r += p.TWO_PI;} - return p.noise(ox + p.cos(r) * dim, oy + p.sin(r) * dim); - } - function getNoiseWithTime (radian, dim, time){ - let r = radian % p.TWO_PI; + const r = radian % p.TWO_PI; if(r < 0.0){r += p.TWO_PI;} return p.noise(ox + p.cos(r) * dim , oy + p.sin(r) * dim, oz + time); }