The inorganic formula creates the generative art of the organic thing.
Wet and organic images from the inorganic formula.
It's a generative art made with the 'Processing'. It generates colorful, wet, and organic images.
I inspired by ntsutae (@ntsutae) san's work on 'desmos' again. On yesterday, I wrote a code with another work of ntsutae san.
I tried to use the values of the halfway of the calculation to determine colors.
Yet another artwork implementation : Wavy shape and gradation color.
Yet another artwork implementation : Limit the drawing.
The 'Processing' example code.
This code does not display any images on the screen but generates image files in frames directory. Please feel free to use this example code under the terms of the GPL. To see other works based on my code is my pleasure. And my honor.
/**
* Bloody Well Right.
* Wet and organic images from the inorganic formula.
* ref. https://twitter.com/ntsutae/status/1349018828907413506
*
* @author @deconbatch
* @version 0.1
* @license GPL Version 3 http://www.gnu.org/licenses/
* Processing 3.5.3
* 2021.01.17
*/
void setup() {
size(980, 980);
colorMode(HSB, 360.0, 100.0, 100.0, 100.0);
rectMode(CENTER);
smooth();
noLoop();
}
void draw() {
int frmMax = 3;
int hW = floor(width * 0.7);
int hH = floor(height * 0.7);
float hueBase = random(360.0);
float complex = 0.3; // 0.3-1.0
translate(width * 0.5, height * 0.5);
for(int frmCnt = 0; frmCnt < frmMax; frmCnt++) {
float xRatio = random(0.005, 0.01);
float yRatio = random(0.005, 0.01);
pushMatrix();
rotate(floor(random(4.0)) * HALF_PI * 0.5);
background(hueBase % 360.0, 10.0, 100.0, 100.0);
noStroke();
for (int x = -hW; x < hW; x++) {
for (int y = -hH; y < hH; y++) {
float x0 = funcX(x * xRatio, y * yRatio, complex);
float y0 = funcY(x * xRatio, y * xRatio, complex);
float x1 = funcX(x0, y0, complex);
float y1 = funcY(x0, y0, complex);
float x2 = funcX(x1, y1, complex);
float y2 = funcY(x1, y1, complex);
float rHue = (hueBase + 360.0 + ((x1 - y1) * 10.0) % 360.0) % 360.0;
float rSat = 80.0 - abs((x0 + y0) * 50.0) % 60.0;
float rBri = 90.0 - abs((x1 + y1) * 5.0) % 90.0;
float rAlp = 100.0 - abs((x0 + y0) * 20.0) % 100.0;
fill(rHue, rSat, rBri, rAlp);
rect(x, y, 1.0, 1.0);
}
}
popMatrix();
casing();
saveFrame("frames/" + String.format("%04d", frmCnt) + ".png");
hueBase += 360.0 / frmMax;
complex += 0.35;
}
exit();
}
/**
* funcX : shape calculate function.
*/
float funcX(float _a, float _b, float _c) {
return (cos(_a * 3.0) - sin(_b * 4.0)) * _c;
}
/**
* funcY : shape calculate function.
*/
float funcY(float _a, float _b, float _c) {
return (_a * _a - _b * _b - _a * _b) * _c;
}
/**
* casing : draw fancy casing
*/
private void casing() {
fill(0.0, 0.0, 0.0, 0.0);
strokeWeight(54.0);
stroke(0.0, 0.0, 50.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);
noStroke();
noFill();
noStroke();
}
/*
Copyright (C) 2021- 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/>
*/