Code Art 01122020


I went through old code and found a neat lerp algorithm. Two circles rotate and a third chases the previous angle between the two moving circles. The path of the third is drawn with very low (I believe it is 5) opacity.

image.png

image.png

image.png

image.png

image.png


let v1,v2,v3,v4;
var size=1;
var rot1=30/100;
var rot2=40/200;


function setup() {
createCanvas(windowWidth, windowHeight);
background(0);

noFill();
v1 = createVector(-20, 20);
v2 = createVector(20, 20);
}


function draw() {
var r = 0;
var g = 255;
var b = 100;

r+=5;

var step=.05;   

translate(width/2,height/2);

v1.rotate(rot1);
v2.rotate(rot2);
v3 = p5.Vector.lerp(v1, v2, step);

stroke((5*second())%255,(6*second())%255,(4*second())%255,5);
ellipse(v3.x,v3.y,size,size);
size+=.1;
}


function roll(n){
return floor(random(n));
}

https://www.openprocessing.org/user/168676#sketches


Comments 2


nice one keep doing on your great work :)

13.01.2020 14:28
1