Skip to content

Instantly share code, notes, and snippets.

@TeddyDD
Created January 11, 2018 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TeddyDD/d1573753ed93e207b46fd00ccc91737a to your computer and use it in GitHub Desktop.
Save TeddyDD/d1573753ed93e207b46fd00ccc91737a to your computer and use it in GitHub Desktop.
processing sketch with japaneese-like charachters
int grid = 24;
void setup() {
size(1600, 900);
frameRate(0.3);
//noLoop();
}
void draw_letter(int strokes, float size, float x, float y) {
for (int p = 0; p < strokes; p++) {
float[] xps = new float[4];
float[] yps = new float[4];
for (int i = 0; i < 4; i++) {
xps[i] = random(0, size) + x;
yps[i] = random(0, size) + y;
}
stroke(random(0,30));
strokeWeight(random(1, 3));
noFill();
bezier(xps[0], yps[0],
xps[1], yps[1],
xps[2], yps[2],
xps[3], yps[3]);
}
}
void draw() {
background(255);
for (int y = 0; y < height; y += height/grid) {
for (int x = 0; x < width; x += width/grid) {
draw_letter((int)random(1, 4), grid-3, x, y);
}
}
saveFrame("znaczki####.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment