xxxxxxxxxx
50
let cylinderRadius = 178;
let textTexture;
let indexWord = 0;
let words = ['Wishing you a happy and healthy New Year!'];
let fnt;
function setup() {
createCanvas(700, 700, WEBGL);
//createLoop({ duration: 4, gif: true });
fnt = loadFont("ConcertOne-Regular.ttf");
textTexture = createGraphics(2 * PI * cylinderRadius, windowHeight * 2);
textTexture.fill(255, 106, 0);
textTexture.textFont(fnt);
textTexture.textAlign(CENTER);
}
function draw() {
noStroke();
let rotation = 0.5;
textTexture.background(56, 1, 255);
textTexture.textSize(57);
for (let i = 0; i <= 55; i++) {
textTexture.text(words[indexWord], PI * cylinderRadius, i * 50);
}
translate(-windowWidth, -100);
for (let i = 0; i <= 12; i++) {
translate(cylinderRadius * 2 + 70, 0);
push();
rotateZ(radians(45));
push();
if (i % 2 == 0) {
rotateY(-frameCount * 0.03);
} else {
rotateY(frameCount * 0.03);
}
texture(textTexture);
cylinder(cylinderRadius, windowHeight * 2, 24);
pop();
pop();
}
}