Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Ann6370331

1 Comments

Sorted by latest first Latest Oldest Best

 

@Welton168

I don't know how to do that with Adobe Animate or Illustrator but you could use Processing.

Here's the code and the result:

void setup() {
size(800, 600);
noCursor();
}

void draw() {
background(34,70,135);

stroke(200,75,130);
strokeWeight(2);

int resolution = 25;
PVector attractor = new PVector(mouseX, mouseY);

for (int x=0; x<width; x+=resolution) {
for (int y=0; y<height; y+=resolution) {

PVector v = getSpiralVector(x-attractor.x, y-attractor.y);

v.normalize().mult(resolution/2);

pushMatrix();
translate(x, y);
line( -v.x, -v.y, v.x, v.y);
popMatrix();
}
}

fill(255,50);
noStroke();
ellipse(mouseX,mouseY,200,200);
}

PVector getSpiralVector(float x, float y) {
return new PVector(y-x, -x-y);
}

void mouseClicked(){
saveFrame(hour()+"_"+minute()+"_"+second()+".png");
}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme