No Words.

It draws a word on the background paint.
 It draws a word on the background paint.
 It draws a word on the background paint.

Description of this generative art.

This generative art was made with Processing programming code.

It draws a word on the background paint.

These words have no special meanings. Just an ordinary word.
I was tried to make some experimental things that put some ordinary words on the beautiful expressive background, then people may find some special meanings on an ordinary word?

Did it work?

Processing example code.

Please feel free to use it, if you like it.
To see another works based on my code is my pleasure. And my honor.


What a shame! 😱
I wrote such a stupidable code like this.
float valSat = map(random(1.0), 0.0, 1.0, 0.0, 20.0);

I've fixed it. Thank you  幽谷響 (@x_YAMABIKO_x) for your indication.



// No Words.
// Processing 3.2.1
// written : 2018.01.08
// updated : 2019.02.09
// map(random(1.0), 0.0, 1.0, 0.0, 20.0) -> random(20.0) etc.

/* ---------------------------------------------------------------------- */
class Words {

  PFont wFont;
  String[][] wItems;
  int wNo;


  Words() {

    wItems = new String[][] {
      {"灰汁", "lye"},
      {"生際", "hairline"},
      {"親猫", "parent cat"},
      {"小魚", "small fish"},
      {"粗茶", "tea"},
      {"太腿", "thighs"},
      {"唐芋", "sweet potate"},
      {"音頭", "lead"},
      {"若輩", "greenhorn"},
      {"土間", "floor mold"},
      {"六畳", "six tatami mat"},
      {"膝頭", "kneecap"},
      {"茶筒", "tea canister"},
      {"賃貸", "rent"},
      {"運賃", "fare"},
      {"鎮座", "enshrinement"},
      {"陳謝", "apologize"},
      {"金柑", "kumquat"},
      {"薀蓄", "extensive knowledge"},
      {"古風", "old-fashioned"},
      {"離脱", "breakaway"},
      {"焼飯", "fried rice"},
      {"単品", "single item"},
      {"弱音", "complaint"},
      {"早寝", "go to bed early"},
      {"脇腹", "flank"},
      {"猿股", "undershorts"},
      //      {"", ""},
    };

    wNo = (int)random(wItems.length);
    println(wItems[wNo][0]);
    println(wItems[wNo][1]);

    //  println(PFont.list());
    // wFont = createFont("Sazanami Mincho Regular",48,true);
    //  wFont = createFont("KouzanBrushFontGyousyo",128,true);
    //  wFont = createFont("KouzanBrushFont",128,true);
    //  wFont = createFont("aoyagireisyosimo2",128,true);
        wFont = createFont("KouzanBrushFontSousyo",128,true);

  }

  void drawWord() {

    int pgW = 420;
    int pgH = 200;
    PGraphics pg = createGraphics(pgW, pgH);
    pg.beginDraw();
    pg.colorMode(HSB, 360, 100, 100, 100);
    pg.background(0.0, 0.0, 100.0, 100.0);
    pg.fill(0.0, 0.0, 50.0, 100.0);
    pg.textFont(wFont); 
    pg.textSize(220);
    pg.text(wItems[wNo][0], 0, pgH - 20);
    pg.endDraw();
    pg.loadPixels();

    translate(-pgW / 2.0, -pgH / 2.0);

    for (int idxW = 0; idxW < pg.width; idxW += 1) {  
      for (int idxH = 0; idxH < pg.height; idxH += 1) {

        color c = pg.pixels[idxH * pg.width + idxW];
        if (brightness(c) != 100.0) {
          float valSat = random(20.0);
          float valBri = brightness(c) * 0.4;
          float valSiz = random(5.0);
          float valAlp = random(60.0);

          fill(210.0, valSat, valBri, valAlp);
          ellipse(idxW, idxH, valSiz, valSiz);
        }

      }
    }

  }

}

/* ---------------------------------------------------------------------- */
class Clouds {

  int cntWidthMax;
  int divRotate;
  int cntRotateMax;
  float baseCloudSize, initCloudSize;
  float baseColor;
  float petalBaseFrom, petalBaseTo, petalDivFrom, petalDivTo;

  Clouds() {
    divRotate = 1;  // divide 360 degree
    cntRotateMax = 30 * 360 * divRotate;  // draw while rotating
    cntWidthMax = 4;  // repeat same shape with different ellipse size
    initCloudSize = 250;
    baseCloudSize = initCloudSize;
    baseColor = random(360);
  }

  void drawClouds() {

    float noiseHueStart = random(100.0);
    float noiseBriStart = random(100.0);
    float noiseAlpStart = random(100.0);
    float noiseSatStart = random(100.0);
    float noiseShpStart = random(100.0);

    for (int cntWidth = 1; cntWidth <= cntWidthMax; ++cntWidth) {
   
      float noiseHue = noiseHueStart;
      float noiseSat = noiseSatStart;
      float noiseBri = noiseBriStart;
      float noiseAlp = noiseAlpStart;
      float noiseShp = noiseShpStart;

      float prmSat = 1.0;
      float prmSiz = cntWidth / 2.0;
      float sumRotation = 0;

      pushMatrix();
      for (int cntRotate = 0; cntRotate < cntRotateMax; ++cntRotate) {

        // rotate fixed degree and calculate the plot point
        float rotation = 1.0 / divRotate;
        canvasRotation(rotation);
        sumRotation += rotation * map(noise(noiseShp), 0.0, 1.0, -0.6, 1.0);

        float posDot = baseCloudSize * (sin(radians(sumRotation)) + map(noise(noiseShp / 2.0), 0.0, 1.0, -0.2, 0.8));
        float brushHue = (baseColor + 360 + map(noise(noiseHue), 0.0, 1.0, -30.0, 30)) % 360;
        float brushSat = map(noise(noiseSat), 0.0, 1.0, 10.0, 40.0) * prmSat;
        float brushBri = map(noise(noiseBri), 0.0, 1.0, 70.0, 90.0) / prmSiz;
        float brushAlp = map(noise(noiseAlp), 0.0, 1.0, 0.0, 3.0) * posDot / baseCloudSize;
        float brushSiz = map(noise(noiseBri), 0.0, 1.0, 0.0, 100.0 * prmSiz);

        drawCloud(posDot, brushHue, brushSat, brushBri, brushAlp, brushSiz);

        // Gas 
        if (cntWidth == cntWidthMax) {
          float distDot = random(4.0);
          drawCloud(posDot * distDot,
                    brushHue,
                    brushSat * 2.0 * posDot * distDot / baseCloudSize,
                    brushBri * 1.0,
                    brushAlp * distDot,
                    brushSiz * 2.0
                    );
        }

        noiseHue += 0.0005;
        noiseSat += 0.0001;
        noiseBri += 0.0002;
        noiseAlp += 0.0003;
        noiseShp += 0.0004;

      }
      popMatrix();

    }

  }

  void drawCloud(float brushPosition, float brushHue, float brushSat, float brushBri, float brushAlp, float brushSiz) {

    noStroke();
    fill(brushHue, brushSat, brushBri, brushAlp);
    ellipse(0.0, brushPosition, brushSiz, brushSiz);

  }
  

  void drawLines() {

    background(0, 0, 90, 100);

    float sizeBase = 15.0;
    float cxnoiseDivBase = random(0.00001, 0.0003);
    float cynoiseBase = random(30.0);
    float csnoiseBase = random(360.0);
  
    float radiusBase = 200.0;
    float cxnoise = 0.0;
    float cynoise = cynoiseBase;
    float csnoise = csnoiseBase;
    float cxnoiseDiv = cxnoiseDivBase;
    float cynoiseDiv = 0.0001;
    float csnoiseDiv = 0.000005;
    int iangleMax = 360 * 68;

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

      radiusBase += radiusBase * 0.00006;
          
      float ang = iangle * 0.05;
      float radius = radiusBase * map(customNoise(cxnoise) + customNoise(cynoise), -2.0, 2.0, 1.0, 1.3);
      float ePtX = radius * cos(radians(ang));
      float ePtY = radius * sin(radians(ang));
      float eSiz = (1.0 + abs(customNoise(csnoise)) * sizeBase) * map(iangle, 0.0, iangleMax, 0.01, 1.0);
      float eAlp = map(abs(customNoise(csnoise)), 0.0, 1.0, 100.0, 0.0);

      strokeWeight(eSiz);
      stroke(0.0, 0.0, 70.0, eAlp);
      line(ePtX, ePtY, radius * cos(radians(ang + 0.1)), radius * sin(radians(ang + 0.1)));

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

    }

  }

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

  void canvasRotation(float degrees) {
    rotate(radians(degrees));
  }
  
  void zooming(float zoomRate) {
    baseCloudSize = initCloudSize * zoomRate;
  }

  float getBaseColor() {
    return baseColor;
  }

}

/* ---------------------------------------------------------------------- */
Clouds cd;
Words wd;

void setup() {

  size(630, 1020);
  colorMode(HSB, 360, 100, 100, 100);
  smooth();
  noLoop();
  noiseSeed(0);

  cd = new Clouds();  
  wd = new Words();  

}

void draw() {

  background(cd.getBaseColor(), 10.0, 95.0, 100.0);
  translate(
            map(random(1.0), 0.0, 1.0, width * 0.3, width * 0.6),
            map(random(1.0), 0.0, 1.0, height * 0.3, height * 0.7)
            );

  cd.drawLines();
  cd.drawClouds();
  wd.drawWord();

  saveFrame("frames/####.png");
  exit();

}


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



No comments :

Post a Comment