xxxxxxxxxx
56
// Recreating the past - Maeda's Morisawa:
// http://tdctokyo.org/eng/wp/wp-content/uploads/2010/08/375d64aec36b9acd72232efd01c79ee3-315x440.jpg
// context: https://rtp.media.mit.edu/
let MoRiSaWa = "モリサワ";
let MoRiSaWa_font;
function preload() {
MoRiSaWa_font = loadFont('MoRiSaWa.ttf');
}
function setup() {
createCanvas(500, 700);
textFont(MoRiSaWa_font);
textAlign(LEFT, TOP);
textSize(width / 4);
}
function draw() {
// cyclic motion to give life to the "silk"
let harmonic = sin(frameCount / 32) / 2;
let breeze = (sin(frameCount / 16) + 6 + harmonic) * width / 16;
clear();
background(255);
for (let i = 0; i < MoRiSaWa.length; i++) {
fill(0);
// get horizontal position of each letter and draw it:
let x = textWidth(MoRiSaWa.substring(0, i));
text(MoRiSaWa[i], x, 0);
// draw a "silk" tentacle!
tentacle(i, x, breeze);
}
}
function tentacle(i, x, breeze) {
let x_curve = x;
let step = 3;
for (let y = 0; y < height; y += step) {
let decrescendo = map(y, 0, height, 200, 0);
fill(0, decrescendo / 50); // opacity decreasing
text(MoRiSaWa[i], x_curve, y);
// give a bit of flex...
x_curve += (4 * step * y / height) * (breeze - x) / width;
}
}