/// seizure warning ///
var dir = 1;
var colorPicker = 1;
var sizeX = 25;
var sizeY = 25;
var width = 640;
var height = 480;
var x = width/2;
var y = height/2;
var x2 = width/2;
var y2 = height/2;
function setup() {
createCanvas(640, 480);
}
function draw() {
//background
switch(colorPicker) {
case 1:
background(252, 156, 231);
break;
case 2:
background(230, 156, 252);
break;
case 3:
background(156, 193, 252);
break;
case 4:
background(252, 249, 156);
break;
default:
background(161, 252, 156);
}
//rectangles
noStroke();
fill('white');
rectMode(CENTER);
translate(mouseX, mouseY);
rotate(radians(mouseY));
//#1
rect(x, y, sizeX, sizeY);
//#2
rect(x2, y2, sizeX, sizeY);
//#3
rect(x, y2, sizeX, sizeY);
//#4
rect(x2, y, sizeX, sizeY);
}
function mouseMoved() {
//burst from center movement
x = mouseX/2;
x2 = -mouseX/2;
y = height/width*(mouseX/2);
y2 = -height/width*(mouseX/2);
//sizechange
sizeX = mouseX/6;
sizeY = mouseX/6;
//background
colorPicker = int(random(1, 6));
}
at the beginning of this project, i really wasn’t sure what i wanted to accomplish with my drawing mechanism, but that allowed me to explore the new topics of translation and rotation even more than i probably would have. i really enjoyed the final result of this project because i already have 10 ideas of how this could be changed in the future! it’s fun to make art + learn at the same time.