# MEDA102 Coding Assignment 2

For this coding assignment I have drawn inspiration from the artist Vera Molnar and her work Computer Rosace Series (http://dada.compart-bremen.de/item/artwork/626). This work demonstrates a series of squares within squares that have various iteration of rotation and line style. I found this work interesting because Molnar experiments with squares but creating an interesting visual aesthetic by the reducing the size of the iterations inwards. I wanted to experiement with this aesthetic as well as experiementing with colour. By creating a geometric shape and the rotations an interesting spiralling affect was formed.

To recreate this work I used techniques learnt in class as well as exploring the use of rotation and the effects of push matrix and pop matrix that create the visual effect. The iterations of the squares created an interesting dynamic. The colours are randomised but are also controlled by limiting the colour range as well as the number of colours that are used. Below is the outcome of the code as well as the code with the comments intergrated.

void setup() {
size(600, 600);
background(255);
noLoop();
noFill();
}

void draw() {
//determine the positioning, size and the rate in which the squares rotate. the number of squares is determined by Repetition
int a = (width/2);
int b = (height/2);
int s = 600;
int Rotation = 0;
int Degree = 3;
int Repitition = 90;
int rate = 2;
rectMode(CENTER); //determines starting point for where shape is drawn from

for (int i = 0; i <Repitition; i = i + 5) { // for loop determining shape repitition count
Colour();
s = s – 30;
pushMatrix();
translate(a,b);
rotate(radians(Rotation)); // rotation formula for shapes
rect(0,0,s,s); //shape positioning and size
popMatrix();
Rotation = Rotation + Degree; //rotation incrementation

s = s-rate; //shape size decrease increment

}
}

void Colour(){

int colour = 3;
int value = 4;
int [][] colArray = new int [colour] [value];

// increment loop in order to acheive new colour for each shape
for (int h = 0; h < colour; h++) {
for (int d = 0; d < value; d++) {

colArray[h][d]= (int)random(150) ; //colour range randomly chosen between 0 and 150

}

int colSelect = (int)random(colour); //sets random colour
fill(colArray[colSelect][0],colArray[colSelect][1],colArray[colSelect][2],colArray[colSelect][3]); //4 colours randomly used
}
}