xxxxxxxxxx
let angulo = 0; //angle
let tajadas = []; //slices
let objeto; //object
let fondo; //background
function preload() {
objeto = loadImage('a2a2.png');//png con letras o figura
fondo = loadImage('fondonnn.png');//fondo
}
function setup() {
createCanvas(fondo.width+600, fondo.height);
imageMode(CENTER);
for (let i = 960; i > 200; i *=0.81) {
noCursor();
let mask = createGraphics(960, 960);
mask.ellipse(960 / 2, 960 / 6, i, i); //you can play around with these values to get more or less forms moving around
let buffer = objeto.get();
buffer.mask(mask);
tajadas.push(buffer);
}
}
function draw() {
translate(width / 2, height / 2);
image(fondo, 0,0);
let time = constrain(frameCount / width, 0, 30);
let targetAngle = time/4 * TWO_PI;
angulo += (targetAngle - angulo) * 0.05;
let s = 1 + abs(targetAngle - angulo) * 0.00;
scale(0.78);
for (let tajada of tajadas) {
rotate(angulo);
image(tajada, 0, 0);
}
}