Hi there! I am learning about loops these weeks and I have been able to do a screen full of rectangles like the one you can see in the picture. Now I would like to do a screen full of quadrilaterals, but If I do a loop all of them are on top of each others. When you create a loop for rect() you can type random positions and sizes, but how could you do the same with quads? I have created a function but I dont know what to do with It !
void setup(){
size(1000,1000);
for(int i=0; i<30; i++){
float x1 = random(width);
float x2 = random(width);
float x3 = random(width);
float x4 = random(width);
float y1 = random(height);
float y2 = random(height);
float y3 = random(height);
float y4 = random(height);
drawQuad(x1,y1,x2,y2,x3,y3,x4,y4);
}
}
void drawQuad(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4){
fill(random(255),random(255),random(255));
noStroke();
quad(x1,y1,x2,y2,x3,y3,x4,y4);
}