Today we’ve to create some generative art using coding by following the assignment. Picture below of what we’ve to create.

After running my code a pattern shows and it all starts to work but it goes off the canvas, I spoken to Chris and we’ve to add another IF statement to make this not go off the canvas and restart in the middle.

My Code:
int north =0;//these are initialised variable
int northEast =1;
int east =2;
int southEast =3;
int south =4;
int southWest =5;
int west =6;
int northWest =7;
int direction;//this has not been initialised
int locX;
int locY;
int stepSize=10;
int diam=10;
void setup(){
size(800,800);
locX = width/2;
locY = width/2;
}
void draw(){
fill(40);
direction = int(random(0,7));
if (direction == north){
locY=locY-stepSize;
}
if (direction == northEast){
locY=locY-stepSize;
locX=locX+stepSize;
}
if (direction == east){
locX=locX+stepSize;
}
if (direction == southEast){
locY=locY+stepSize;
locX=locX+stepSize;
}
if (direction == south){
locY=locY+stepSize;
}
if (direction == southWest){
locY=locY+stepSize;
locX=locX-stepSize;
}
if (direction == west){
locX=locX-stepSize;
}
if (direction == northWest){
locX=locX-stepSize;
locY=locY-stepSize;
}
ellipse(locX,locY,diam,diam);
}
With my code running I’ve a grey background with black dots, I want to change these, below I’ve found a picture of an generative art. I like the black background because it makes everything stand out more. So I’m going to change my background to the colour black.

Also I’ve found another peace of generative art and I really like all the different colours but the one that stands out more to me is yellow, and yellow is a more of a stand out colour, it attracts the human eye. So I’ll use the colour yellow for my dots that will randomize across the screen when the code is ran.
I found these pictures on google, all I typed in is ‘generative art’ and loads will come up.
Now I’ve edited the code you can see (picture below) that when I run the code the background is now black and the little dots are now yellow.

I looked more into the second picture I found (below) and I just liked the multi colours int he pictures, so I done some research on processing codes and found a way when the dots appear, they’re randomized colours, so when the codes run they will be different colours everytime and that’s what I want, I don’t just want the same colours, I want it to be different. (below I’ve left a picture of my code when its being run).

Click here for the site I found the code to make the dots all randomized.
After running my code and leaving it for a good 5minutes this is what it looks like (picture below)

Chris was talking to the class about the function ‘LerpColor’ and it changes the colour of the dots but on the left side it would be red, the middle would beo orange and the right side would be yellow. Below is a picture of my code when its running and you can see the colours from left to right are different.
Me and Chris found some glitches in the code, in the picture you can see one or two different colour dots that are not in the correct colour, on the left where the Red colour is you can see some yellow dots. I’ll fix that and update it all.
