let name = ["Emily Oberman", "James Turrell", "Studio Drift", "Joonmoe", "Mark Ryden", "Nick Cave", "Gwen John", "Matthew Barney", "Daito Manabe", "Dieter Rams", "Giorgia Lupi", "Milton Glaser", "Chino Kim", "Jonathan Thirkield", "Wave VR", "The Pudding", "Reza Ali", "Synthestruct", "Sultan Shepard", "Neri Oxman", "Wassily Kandinsky", "Olafur Eliasson", "Sosolimited", "Daniel Arsham", "Annie Leibovitz", "Courtney Mattison", "O.OO", "Beth Cavener", "Toby Fox", "Alexander Calder", "Guoqiang Cai", "Metahaven", "Hito Steyerl", "Lucy Hardcastle", "Simone Rebaudengo", "Ragnar Kjartansson", "Patrick Demarchelier", "Fons Mans", "Paula Scher", "Banksy", "Naoto Fukasawa", "The Weeknd", "Pauline Saglio", "Dunne and Raby", "Henrietta Harris"]
gravityTime, saveYes = false
for (let i = 0; i < name.length; i++) {
img[i] = loadImage(name[i] + ".jpeg")
createCanvas(windowWidth, windowHeight);
for (let i = 0; i < name.length; i++) {
imagers.push(new Imager(i, img[i], name[i]))
for (let i = 0; i < imagers.length; i++) {
for (let j = 0; j < i; j++) {
imagers[i].collide(imagers[j]);
for (let i = 0; i < imagers.length; i++) {
save('Gen_Poster_' + hour() + minute() + second() + '.jpg')
constructor(num, img, name) {
this.pos = createVector(random(width / 5 * 4), random(height / 5 * 4))
this.vel = p5.Vector.random2D().mult(random(3));
this.r = this.img.height / this.img.width
this.r = (this.w >= this.h) ? this.w : this.h
this.r = (this.pr + params.distance + 20) / 2
translate(this.pos.x, this.pos.y)
image(this.img, -this.w / 2, -this.h / 2, this.w, this.h)
text("[ "+this.num+" ] "+this.name, -this.w / 2, this.h/2 + 6)
let relative = p5.Vector.sub(other.pos, this.pos);
let bdist = relative.mag() - (this.r + other.r);
let movement, approachSpeed
movement = relative.copy().setMag(abs(bdist / (5 - params.speed)));
let thisToOtherNormal = relative.copy().normalize();
approachSpeed = this.vel.dot(thisToOtherNormal) + -other.vel.dot(thisToOtherNormal);
let approachVector = thisToOtherNormal.copy().setMag(approachSpeed);
this.vel.sub(approachVector);
other.vel.add(approachVector);
this.w = random(params.minWidth, params.maxWidth)
this.r = this.img.height / this.img.width
this.r = (this.w >= this.h) ? this.w : this.h
this.pos = createVector(random(width / 5 * 4), random(height / 5 * 4))
if (this.pos.x - this.w < params.borderX) {
this.pos.x = params.borderX + this.w;
this.vel.x = -this.vel.x * 0.2;
if (this.pos.x > width - this.w - params.borderX) {
this.pos.x = width - this.w - params.borderX;
this.vel.x = -this.vel.x * 0.2;
if (this.pos.y - this.h < params.borderY) {
this.pos.y = params.borderY + this.h;
this.vel.y = -this.vel.y * 0.2;
if (this.pos.y > height - this.h - params.borderY) {
this.pos.y = height - this.h - params.borderY;
this.vel.y = -this.vel.y * 0.2;
if (frameCount < gravityTime) {