xxxxxxxxxx
52
let wheels = [];
let w;
let h;
let keypoints = [];
let rader = 15
let numKeyPoints = 15
function setup() {
createCanvas(windowWidth,windowHeight);
w = floor(width/rader)
h = floor(height/rader)
for (let i = 0; i < w; i++) {
for (let j = 0; j < h; j++) {
let r = rader;
let x = i * (width / (w - 1));
let y = j * (height / (h - 1));
let RColour = 180;
let GColour = 0;
let BColour = 0;
let b = new Wheel(x, y, r, RColour, GColour, BColour);
wheels.push(b);
}
}
for (let i = 0; i < floor(numKeyPoints); i++) {
let r = rader//*15;
let x = random(r,width-r);
let y = random(r,height-r);
let RColour = random(255);
let GColour = random(255);
let BColour = random(255);
let xspeed = 5;
let yspeed = 5;
let xdirection = random(-2, 2);
let ydirection = random(-2, 2);
let b = new Wheel(x, y, r, RColour, GColour, BColour,xspeed,yspeed,xdirection,ydirection);
keypoints.push(b);
}
}
function draw() {
background(200);
drawConections();
for (let k of keypoints) {
// k.show(k.RColour,k.GColour,k.BColour)
// k.show(50,50,50)
k.move()
}
}