xxxxxxxxxx
21
function setup() {
createCanvas(460, 400);
}
function draw() {
background(255);
t = frameCount;//time in frames
x = 60;//divisor for speed adjustment
c = 255;//color
for (let i = 0; i < 13; i++){//i = number of weights
fill(c, c, c);
c = c-10;
X = 100*sin(t/(x-i*2));//Asin(t)- back and forth
Y = 15*cos(t/((x-i*2)/2));//Acos(t) - up and down
line(120,(x-i*2)*2,X+120, 300 + Y);//front view string
circle(X+120,Y+300, 20,20);//front view weight
line(X+350,60+i*20,350,60+i*20)//top view string
circle(X+350,60+i*20,10) //top view weight
}
}