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.
// Processing 3.2.1
// 2017.12.24

int centx;
int centy;
float colorBase;
float rotationBase;
float sizeBase;
float cxnoiseDivBase;
float cynoiseBase;
float csnoiseBase;

void setup() {
  
  size(900, 900);
  colorMode(HSB, 360, 100, 100, 100);
  smooth();
  //  noLoop();
  noStroke();

  centx = width / 2;
  centy = height / 2;
  colorBase = random(0.0, 360.0);
  rotationBase = random(0.0, 90.0);
  sizeBase = 20.0;
  cxnoiseDivBase = map(random(1.0), 0.0, 1.0, 0.00005, 0.00025);
  cynoiseBase = map(random(1.0), 0.0, 1.0, 0.0, 360.0);
  csnoiseBase = map(random(1.0), 0.0, 1.0, 0.0, 360.0);
  
}

void draw() {

  background(0, 0, 90, 100);
  translate(centx, centy);

  rotationBase -= 0.08;
  cxnoiseDivBase += 0.0000003; // wave
  cynoiseBase += 0.00002; // roll
  csnoiseBase += 0.00005; // blink

  float radiusBase = 15.0;
  float cxnoise = 0.0;
  float cynoise = cynoiseBase;
  float csnoise = csnoiseBase;
  float cxnoiseDiv = cxnoiseDivBase;
  float cynoiseDiv = 0.01;
  float csnoiseDiv = 0.005;
  int iangleMax = 360 * 68;

  canvasRotation(rotationBase);
  
  for (int iangle = 0; iangle <= iangleMax; ++iangle) {

    if (radiusBase > width * 0.6) {
      break;
    }
    radiusBase += radiusBase * 0.00015;
          
    float ang = iangle * 0.1;
    float radius = radiusBase * map(customNoise(cxnoise) + customNoise(cynoise), -2.0, 2.0, 1.0, 1.6);
    float ePtX = map(cos(radians(ang)), -1.0, 1.0, -radius, radius);
    float ePtY = map(sin(radians(ang)), -1.0, 1.0, -radius, radius);
    float eSiz = (2.0 + abs(customNoise(csnoise)) * sizeBase) * map(iangle, 0.0, iangleMax, 0.01, 1.0);
    float eAlp = 100.0 - abs(customNoise(csnoise)) * 100.0;

    fill(colorBase, 60, 40, eAlp);
    ellipse(ePtX, ePtY, eSiz, eSiz);

    cxnoise += cxnoiseDiv;
    cynoise += cynoiseDiv;
    csnoise += csnoiseDiv;

  }

  saveFrame("frames/mo####.png");
  if (frameCount > 540) {
    exit ();
  }
  
}

float customNoise(float value) {
  return pow(sin(value), 3) * cos(pow(value, 2));
}

void canvasRotation(float degrees) {
  rotate(radians(degrees));
}

/*
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/>
*/