The fruits of the 'Accident Programming method'.

Some interesting shapes made with my Accidental Programming method.


Interesting shapes came out by chance.

It's a creative coding artwork made with the 'Processing' programming code. It draws interesting wave shapes and animates these.

Some interesting shapes made with my Accidental Programming method.

 

My 'Accidental Programming Method' worked!

When I was playing around Indian Ink Splashes, it created some interesting shapes like this.


Some interesting shape I found.

It was so interesting to me! I improved it to make the shapes clearly. It will create different shapes every time.







 

The 'Processing' code example.

Please feel free to use this code under the terms of the GPL. To see other works based on my code is my pleasure. And my honor.

 

Add 20/06/10

Oh... What a shame... This code has no sense.

map(random(1.0), 0.0, 1.0, 0.00005, 0.00025);

It should be.

random(0.00005, 0.00025);

/**
 * Interstellar Overdrive.
 * Accidental Programming Method worked!
 * 
 * @author @deconbatch
 * @version 0.2
 * @license GPL Version 3 http://www.gnu.org/licenses/
 * Processing 3.5.3
 * 2017.12.24 ver 0.1
 * 2022.05.21 ver 0.2 refactored
 */

float hueBase; // base hue value

// noise params
float npxBase;
float npyBase;
float npzBase;

void setup() {
  
  size(720, 720);
  colorMode(HSB, 360, 100, 100, 100);
  smooth();

  hueBase = random(360.0);
  npxBase = 0.0;
  npyBase = random(100.0);
  npzBase = random(100.0);
  
}

void draw() {

  int   stepMax  = 24000;
  float cycleMax = 4;
  float sizeBase = 2.0;
  float npxDiv   = 0.0001; // spiral radius change
  float npyDiv   = 0.006;  // shape
  float npzDiv   = 0.018;  // dot size change

  npxBase += 0.005;	  // wave
  npyBase -= 0.00005;	// roll
  npzBase += 0.0002;	// blink
  
  float npx = npxBase;
  float npy = npyBase;
  float npz = npzBase;

  background(0, 0, 80, 100);
  noStroke();
  translate(width * 0.5, height * 0.5);

  pushMatrix();
  rotate(-frameCount * 0.001);
  for (int step = 0; step <= stepMax; step++) {

    float sRatio = map(step, 0, stepMax, 0.0, 1.0);

    float rBase = 1.0 + sRatio * width * 0.6;
    float theta = step * cycleMax * TWO_PI / stepMax;
    
    float eR = rBase * map(customNoise(npx) + customNoise(npy), -2.0, 2.0, 0.8, 1.25);
    float eX = eR * cos(theta);
    float eY = eR * sin(theta);
    float eS = sizeBase * (abs(customNoise(npz)) + sRatio * 2.0);
    float eHue = hueBase + map(eR, rBase * 0.8, rBase * 1.25, 0.0, 60.0) + sRatio * 90.0;
    float eSat = 30.0 + sRatio * 30.0;
    float eBri = 20.0 + sRatio * 40.0;
      
    fill(eHue % 360, eSat, eBri, 100);
    ellipse(eX, eY, eS, eS);

    npx += npxDiv;
    npy += npyDiv;
    npz += npzDiv;

  }
  popMatrix();

  casing();

}

/**
 * customNoise : returns -1.0 ... 1.0
 */
float customNoise(float value) {
  return pow(sin(value), 3) * cos(pow(value, 2));
}

/**
 * casing : draw fancy casing
 */
private void casing() {
  rectMode(CENTER);
  fill(0.0, 0.0, 0.0, 0.0);
  strokeWeight(54.0);
  stroke(0.0, 0.0, 0.0, 100.0);
  rect(0.0, 0.0, width, height);
  strokeWeight(50.0);
  stroke(0.0, 0.0, 100.0, 100.0);
  rect(0.0, 0.0, width, height);
}


/*
Copyright (C) 2022- 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