carley johnson curves

sketch

/*Carley Johnson
Section E
cbjohnso@andrew.cmu.edu
Project 07
*/

let x = 0;
let y = 0;
let ang = 90;
let col = 0;
let moveC = 1;

function setup() {
  createCanvas(480, 480);
  angleMode(DEGREES);
}

function draw() {
  background(random(100, 255), random(200, 50), random(0, 255), 5);
  stroke(100, 100, 40);

  //moving the color value
  col += moveC;
  fill(col + 50, 20, 20);
    if (col >= 100 || col < 0) {
      moveC = moveC * -1;
  }

  //rotate around the center
  translate(width/2, height/2);
  //rotation increments
  rotate(x);
  x+=1;
  //draws ellipse
  for (i = 0; i < 360; i += 13) {
  ellipse(-mouseX + cos(i++) * width / (400 / 72), width / 20 + sin(i++) * width / (400 / 72), width / 20 + mouseX, width / 20 -mouseY);
  }



}

I was not a fan of this project, the curves were all so daunting and cos/sin is really something that confuses me. I’m satisfied with the spiral the circles rotate around according to your mouse, but this was not a great project for me. Hopefully next week I can produce something more aesthetically pleasing.

Leave a Reply