My works for TDSW x PCJ event in GreenHouse NAXOS.

My work for TDSW x PCJ event in GreenHouse NAXOS.

TDSW x PCJ Vernissage in GreenHouse NAXOS.

Tokyo Developers Study Weekend (TDSW) and Processing Community Japan (PCJ) held 'TDSW x PCJ Vernissage' in the GreenHouse NAXOS.
The GreenHouse NAXOS is an online exhibition plat home of the NODE Forum the digital art event on 2-8 Oct 2020.

The host invited everyone to bring their works to display in the GreenHouse NAXOS. And I brought these.

Thank you NODE Forum.

Thank you GreenHouse NAXOS.

Ein Beispielcode in der Programmiersprache Processing.



/**
 * My work for TDSW x PCJ event in the GreenHouse NAXOS.
 * 
 * @author @deconbatch
 * @version 0.1
 * @license GPL Version 3 http://www.gnu.org/licenses/
 * Processing 3.5.3
 * 2020.10.04
 */

void setup() {
  size(980, 640);
  colorMode(HSB, 360.0, 100.0, 100.0, 100.0);
  rectMode(CENTER);
  noLoop();
}

void draw() {

  float margin = 30.0;
  float panelW = (width - margin * 2.0);
  float panelH = (height - margin * 2.0);
  ArrayList<PVector> pList = new ArrayList<PVector>();

  background(0.0, 0.0, 90.0, 100.0);

  pushMatrix();
  translate(margin, margin);
  pList = text2Points(
                      "ALL YOUR BASE\nARE\nBELONG TO US!!",
                      panelW, panelH, 100, 6, 0.5
                      );
  drawMatrix(pList, random(360.0));
  popMatrix();
  casing();

  saveFrame("frames/oioi.01.png");
  exit();
  
}

/**
 * text2Points : get array of random location within the text shape.
 * @param  _text  : sample text
 * @param  _w, _h : canvas size to draw sample text
 * @param  _size  : text size
 * @param  _gap   : location sampling gap
 * @param  _dens  : probability to get location
 * @return        : result in array of PVector.
 */
ArrayList<PVector> text2Points(String _text, float _w, float _h, int _size, int _gap, float _dens) {

  ArrayList<PVector> points = new ArrayList<PVector>();
  
  PGraphics p = createGraphics(floor(_w), floor(_h));
  p.beginDraw();
  p.colorMode(HSB, 360, 100, 100, 100);
  p.textFont(createFont("FreeSans Bold", 10, true));
  p.background(0, 0, 100, 100);
  p.translate(p.width * 0.5, p.height * 0.5);
  p.fill(0, 0, 0, 100);
  p.textAlign(CENTER,CENTER);
  p.textSize(_size);
  p.text(_text, 0, 0);
  p.endDraw();

  image(p, 0, 0);
  
  p.loadPixels();
  for (int idxH = 0; idxH < p.height - 1; idxH += _gap) {
    for (int idxW = 0; idxW < p.width - 1; idxW += _gap) {  
      if (random(1.0) < _dens) {
        int pixIndex = idxH * p.width + idxW;
        if (brightness(p.pixels[pixIndex]) <= 99.0) {
          points.add(new PVector(idxW, idxH));
        }
      }
    }
  }
  return points;
  
}

/**
 * drawMatrix : draw matrix with the points.
 *              You may need to tune brightness, strokeWeight, etc.
 * @param  _pvs     : points to draw in array of PVector
 * @param  _baseHue : base hue value to draw
 */
private void drawMatrix(ArrayList<PVector> _pvs, float _baseHue) {

  blendMode(SCREEN);
  for (int f = 0; f < _pvs.size() - 1; f++) {
    int cons = 0;
    float xF = _pvs.get(f).x;
    float yF = _pvs.get(f).y;
    float hueVal = (_baseHue + 360.0 + cos(0.002 * (xF + yF)) * 90.0) % 360.0;
    
    noFill();
    for (int t = f + 1; t < _pvs.size(); t++) {
      if (random(1.0) < 10.5) {
        float xT = _pvs.get(t).x;
        float yT = _pvs.get(t).y;
        if (abs(xF - xT) < 1.0 || abs(yF - yT) < 1.0) {
          if (abs(yF - yT) < 1.0) {
            stroke(hueVal, 90.0, 1.0, 100.0);
            strokeWeight(1.0);
          } else {
            stroke(hueVal, 90.0, 8.0, 100.0);
            strokeWeight(4.0);
          }
          line(xF, yF, xT, yT);
          cons++;
        }
      }
    }

    if (cons % 2 == 0) {
      strokeWeight(1.0);
      stroke(hueVal, 90.0, 80.0, 100.0);
      noFill();
    } else {
      noStroke();
      fill(hueVal, 90.0, 80.0, 100.0);
    }
    int siz = cons % 8;
    ellipse(xF, yF, siz, siz);
  }
  blendMode(BLEND);
}

/**
 * casing : draw fancy casing
 */
public void casing() {
  fill(0.0, 0.0, 0.0, 0.0);
  strokeWeight(30.0);
  stroke(0.0, 0.0, 0.0, 100.0);
  rect(width * 0.5, height * 0.5, width, height);
  strokeWeight(28.0);
  stroke(0.0, 0.0, 100.0, 100.0);
  rect(width * 0.5, height * 0.5, width, height);
}

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


 Noch ein Beispielbild.

 

Beweisfoto vor Ort.






Next Post Previous Post
No Comment
Add Comment
comment url