Sunteți pe pagina 1din 4

function setup() {

createCanvas(1500, 1500);

function draw() {

background(0,0,102);

push();

ellipseMode(CENTER);

translate(width * 0.5, height * 0.5);

rotate(frameCount / 50.0);

fill(255, 255, 0);

star(0, 0, 80, 150, 40);

//1

/* circle(50, 50, 400);

noFill();*/

ellipseMode(CENTER);

rotate(millis() /500);

fill(51, 51, 77);

ellipse(20,150,15,15);

//2

fill(230, 92, 0);

ellipse(120,150,25,25);

//3

rotate(frameCount/-11);

fill(0, 0, 204);

ellipse(250,0,60,60);

//4

rotate(millis() /500);

fill(204, 0, 0);

ellipse(290,0,35,35);
rotate(frameCount/100);

fill(210, 166, 121)

ellipse(350,0,60,60);

rotate(frameCount/-200);

fill(255, 230, 204);

ellipse(450,0,45,45);

rotate(frameCount/-200);

fill(0, 204, 153);

ellipse(550,500,45,45);

rotate(frameCount/-100);

fill(0, 163, 204);

ellipse(550,300,45,45);

/*

rotate(frameCount * 50.0);

ellipse(50,150,30,30);

*/

pop();

noFill();

circle(750, 750, 300, 60);

noFill();

circle(750, 750, 380, 60);

noFill();

circle(750, 750, 500, 60);


noFill();

circle(750, 750, 580, 60);

noFill();

circle(750, 750, 700, 60);

noFill();

circle(750, 750, 900, 60);

noFill();

circle(750, 750, 1250, 60);

noFill();

circle(750, 750, 1490, 60);

/* let x=0;

let y=0;

let a=120;

translate(width / 2, height / 2);

for(i=1;i<=8;i++){

if(i%2==0)

a=70;

else if(i%5==0) a=120;

else if(i%3==0) a=35;

translate(p5.Vector.fromAngle(millis() / 800, a));

ellipse(x,y, 30,30);

x=x+50;

y=y+120;

*/
function star(x, y, radius1, radius2, npoints) {

let angle = TWO_PI / npoints;

let halfAngle = angle / 2.0;

beginShape();

for (let a = 0; a < TWO_PI; a += angle) {

let sx = x + cos(a) * radius2;

let sy = y + sin(a) * radius2;

vertex(sx, sy);

sx = x + cos(a + halfAngle) * radius1;

sy = y + sin(a + halfAngle) * radius1;

vertex(sx, sy);

endShape(CLOSE);

S-ar putea să vă placă și