Simple application example of the Perlin noise

Many circles that controlled with the Perlin noise.

Simple artwork using 2D Perlin noise.

This is the creative coding artwork made with the 'Processing'.

This drawing concept is so simple. It's just an implementation with 2D Perlin noise. It features the ellipse size with the Perlin noise. It's also a 2D version of Hydrangea Glaze with glowing wire.







 

The 'Processing' example code.

Please feel free to use this example code under the terms of the GPL.

// How The Web Was Woven
// Processing 3.2.1
// 2017.08.21

void setup() {

  size(1080, 1080);
  colorMode(HSB, 360, 100, 100, 100);
  blendMode(SCREEN);
  noFill();
  smooth();
  noLoop();
  //  frameRate(1);

}

void draw() {

  background(0, 0, 8);
  drawPixels();
   
  saveFrame("frames/####.png");
  exit();

}

void drawPixels() {
  
  int idxDiv = 60;
  float baseColor = random(360.0);

  float noiseSizWStarter = random(50);
  float noiseSatWStarter = random(50);
  float noiseBriWStarter = random(50);
  float noiseAlpWStarter = random(50);

  float noiseSizHStarter = random(50);
  float noiseSatHStarter = random(50);
  float noiseBriHStarter = random(50);
  float noiseAlpHStarter = random(50);


  for (int cntDraw = 1; cntDraw <= 10; ++cntDraw) {

    float noiseSizW = noiseSizWStarter;
    float noiseSatW = noiseSatWStarter;
    float noiseBriW = noiseSatWStarter;
    float noiseAlpW = noiseAlpWStarter;

    noiseSatWStarter += 0.02;
    strokeWeight(0.1 * cntDraw * cntDraw);

    for (int idxW = -idxDiv; idxW <= width + idxDiv; idxW += idxDiv) {  

      float noiseSizH = noiseSizHStarter;
      float noiseSatH = noiseSatHStarter;
      float noiseBriH = noiseSatHStarter;
      float noiseAlpH = noiseAlpHStarter;

      noiseSatHStarter += 0.02;

      for (int idxH = -idxDiv; idxH <= height + idxDiv; idxH += idxDiv) {

        float valSiz = map(noise(noiseSizW, noiseSizH), 0.0, 1.0, 4.9 * idxDiv, 2.1 * idxDiv); // magic value
        float valHue = map(noise(noiseSatW, noiseSatH), 0.0, 1.0, baseColor, baseColor + 60.0) % 360;
        float valSat = map(noise(noiseSatW, noiseSatH), 0.0, 1.0, 30.0, 80.0);
        float valBri = map(noise(noiseBriW, noiseBriH), 0.0, 1.0, 60.0, 100.0);
        float valAlp = map(noise(noiseAlpW, noiseAlpH), 0.0, 1.0, 10.0, 100.0);
        
        pushMatrix();
        translate(idxW, idxH);
        stroke(valHue, valSat, valBri / cntDraw, valAlp);
        ellipse(0.0, 0.0, valSiz, valSiz);
        popMatrix();

        noiseSizH += 0.03;
        noiseSatH += 0.01;
        noiseBriH += 0.08;
        noiseAlpH += 0.10;
        
      }

      noiseSizW += 0.03;
      noiseSatW += 0.01;
      noiseBriW += 0.08;
      noiseAlpW += 0.10;

    }
  }
}

/*
Copyright (C) 2017- deconbatch

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>
*/



 

Next Post Previous Post
No Comment
Add Comment
comment url