Oscillating colours
I built on a Processing sketch using oscillate and grid function by adding different shapes and colours. The effects are interesting.
You can add as many shapes as you’d like and amend the colours to suit whatever you’d like to see.
The code is below in case you’d like to try it yourself with Processing.
cell [][]grid; int cols = height; int rows = width;
void setup() { size(800, 800); noStroke(); grid = new cell [cols][rows]; for (int i = 0; i < cols; i++) { for (int j = 0; j < rows; j++) { grid[i][j]=new cell(i*70, j*70, 60, 60, i+j); } } }
void draw() { background(0); for (int i =0; i < cols; i++) { for (int j =0; j < rows; j++) { grid[i][j].oscillate(); grid[i][j].display(); } } //To save your frames un comment this. saveFrame("shapes-###.png"); }
class cell { float x, y; float w, h; float angle;
cell(float tempX, float tempY, float tempW, float tempH, float tempAngle) { x = tempX; y = tempY; w = tempW; h = tempH; angle = tempAngle; } void oscillate() { angle += 1; }
void display() { colorMode(HSB, 100); //go crazy with this colour set fill(random(10,100),random(100,50),random(20,185)); //rect(x,y,w,h); arc(x, y, 80, 45, 0, PI+QUARTER_PI, CHORD); //fill(random(0,20),random(25,100),random(20,200)); triangle(x,y,(x+w),(y-h),(x+(2*w)),y); //Add as many colours and shapes as you want. //fill(random(0,90),random(200,255), random(160,90)); //triangle((x+10),(y+10),((x+w)+10),((y-h)+10),((x+(2*w))+10),(y+10)); } }














