Start from a simple square and follow different evolutionary paths to create a complex animation. Each step the AI will create a new animation based on the previous one and your prompt.
function setup() {
let canvas = createCanvas(600, 600, WEBGL);
canvas.parent('animation-holder');
resizeAnimation();
}
let cubes = [];
let circles = [];
let gridResolution = 5;
function mouseClicked() {
gridResolution = floor(random(2, 11));
}
function draw() {
background(255, 204, 0, 255);
strokeWeight(5);
translate(-300, -300);
for (let i = 0; i < gridResolution * gridResolution; i++) {
let x = (i % gridResolution) * (600 / gridResolution);
let y = Math.floor(i / gridResolution) * (600 / gridResolution);
let z = noise(frameCount * 0.01 + i * 0.1) * 200 - 100;
let displacement = noise(frameCount * 0.01 + i * 0.2) * 100 - 50;
let rotationX = noise(frameCount * 0.01 + i * 0.3) * TWO_PI;
let rotationY = noise(frameCount * 0.01 + i * 0.4) * TWO_PI;
let rotationZ = noise(frameCount * 0.01 + i * 0.5) * TWO_PI;
push();
translate(x + displacement, y + displacement, z + displacement);
rotateX(rotationX);
rotateY(rotationY);
rotateZ(rotationZ);
let colorValue = sin(frameCount * 0.05 + i * 0.1) * 127 + 128;
fill(255, colorValue * 0.8, 0, 255);
let boxSize = 35 + noise(frameCount * 0.01 + i * 0.2) * 15 + sin(frameCount * 0.05 + i * 0.1) * 15;
box(-boxSize / 2, -boxSize / 2, boxSize * 2);
push();
fill(255, 0, 0, 255);
ellipse(0, 0, 10 + noise(frameCount * 0.01 + i * 0.1) * 20 + sin(frameCount * 0.02 + i * 0.2) * 10);
pop();
pop();
}
for (let i = 0; i < 20; i++) {
let circleX = noise(frameCount * 0.01 + i * 0.2) * 400 - 200;
let circleY = noise(frameCount * 0.01 + i * 0.3) * 400 - 200;
let circleZ = noise(frameCount * 0.01 + i * 0.4) * 400 - 200;
push();
translate(circleX, circleY, circleZ);
stroke(0, 255);
fill(255, 255);
ellipse(0, 0, 25 + noise(frameCount * 0.01 + i * 0.1) * 50 + sin(frameCount * 0.02 + i * 0.3) * 25);
pop();
}
}
The idea of this project is to evolve animations using AI. You can enter in the input field below how you
want to change the animation that you currently see. The AI will then generate a new animation based on your input.
If you don't like the result, you can just press the back button in your browser and try again. If you do like
the result, you can enter another prompt to further evolve the animation.
The animation you see is derived from a parent animation. You can see the parent animation
by clicking on the thumbnail image to the left. The current animation evolved from the parent using these
instructions: redcude the number of cirles and centre the grid. make mouse control.
Now it is your turn. Enter your instructions. For example, add more objects, change colors or change how things
move. The AI will try to generate a new animation based on your input.
The only way housework could be done in this place was with a shovel or, for preference, a match. -- (Terry Pratchett, Witches Abroad)