xxxxxxxxxx
71
let width = 300;
let height = 400;
let rry = [];
let cam;
let angle = 0;
function setup() {
createCanvas(width,height,WEBGL);
angleMode(DEGREES);
rectMode(CORNER);
ellipseMode(CENTER);
cam = createCamera();
for(let i = 0; i<30; i++){
let c = 'hsba('+floor(random(360))+',100%,100%,'+0.5+')';
let r = random(-360,360);
let s = new Worm(c,random(-180,180),r);
rry.push(s);
}
}
function draw(){
background(0);
let r = 800;
let x = sin(angle) * r;
let y = cos(angle) * r;
camera(x, 0,y, 0, 0, 0, 0, 1, 0);
noFill();
//
// sphere(100)
for(let i = 0; i<rry.length; i++){
rry[i].display();
rry[i].update();
}
angle+=1;
}