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();
resizeAnimation();
resizeAnimation();
obstacles = [];
for (let i = 0; i < 10; i++) {
obstacles.push(createVector(random(-width/2, width/2), random(-height/2, height/2)));
}
}
let particles = [];
function draw() {
background(150);
let numParticles = 50;
for (let i = 0; i < numParticles; i++) {
let newParticle = new Particle(random(-width/2, width/2), -height/2);
particles.push(newParticle);
}
for (let i = particles.length - 1; i >= 0; i--) {
particles[i].update();
particles[i].show();
for (let j = 0; j < obstacles.length; j++) {
if (dist(particles[i].x, particles[i].y, obstacles[j].x, obstacles[j].y) < 16) {
particles[i].vx = random(-2, 2);
particles[i].vy = random(2, 8);
}
}
if (particles[i].finished()) {
particles.splice(i, 1);
}
}
}
class Particle {
constructor(x, y) {
this.x = x;
this.y = y;
this.vx = random(-2, 2);
this.vy = random(2, 8);
this.alpha = 255;
}
finished() {
return this.y > height/2 || this.alpha < 0;
}
update() {
this.x += this.vx;
this.y += this.vy;
this.vy += 0.1;
this.alpha -= 5;
}
show() {
noStroke();
fill(255, 0, 0, this.alpha);
ellipse(this.x, this.y, 16, 16);
}
}
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: Fluid should hit random hidden obstacles.
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.
Screw up your courage! You've screwed up everything else.