xxxxxxxxxx
/*
Art 3001 Line Assignment
-Four quadrants with moving colored lines, each quadrant having different constraints and using random elements for drawing
-Quadrant 1 has lines moving along the vertical edges
-Quadrant 2 has lines moving along the horizontal edges
-Quadrant 3 has lines moving along all edges
-Quadrant 4 has lines moving anywhere inside the quadrant
Created by Travis McDaniel
on 1/25/17
Travis959200@gmail.com
*/
void setup()
{
size(800, 800);
frameRate(15);
}
//Global Variable Declarations
//Quadrant 1 line coordinates
float q1y1 = 0;
float q1y2 = 10;
float q1y3 = 200;
float q1y4 = 300;
float q1y5 = 300;
float q1y6 = 200;
float q1y7 = 100;
float q1y8 = 0;
//Quadrant 2 line coordinates
float q2x1 = 400;
float q2x2 = 500;
float q2x3 = 600;
float q2x4 = 700;
float q2x5 = 700;
float q2x6 = 600;
float q2x7 = 500;
float q2x8 = 400;
//Quadrant 3 line coordinates
float q3y1 = 400;
float q3y2 = 800;
float q3y3 = 400;
float q3y4 = 800;
float q3y5 = 400;
float q3y6 = 800;
float q3y7 = 400;
float q3y8 = 800;
float q3x1 = 400;
float q3x2 = 0;
float q3x3 = 400;
float q3x4 = 0;
float q3x5 = 0;
float q3x6 = 400;
float q3x7 = 0;
float q3x8 = 400;
//Quadrant 4 line coordinates
float q4y1 = random(300)+500;
float q4y2 = random(300)+500;
float q4y3 = random(300)+500;
float q4y4 = random(300)+500;
float q4y5 = random(300)+500;
float q4y6 = random(300)+500;
float q4y7 = random(300)+500;
float q4y8 = random(300)+500;
float q4x1 = random(300)+500;
float q4x2 = random(300)+500;
float q4x3 = random(300)+500;
float q4x4 = random(300)+500;
float q4x5 = random(300)+500;
float q4x6 = random(300)+500;
float q4x7 = random(300)+500;
float q4x8 = random(300)+500;
void draw()
{
//Variable Declarations
//Measurement Clarifiers
float verticalEdge = width/2; //Vertical quadrant edge
float horizontalEdge = height/2; //Horizontal quadrant edge
//Color presets
float black = 0;
float white = 255;
float red = new float[3];
red[0] = 200;
red[1] = 0;
red[2] = 0;
float green = new float[3];
green[0] = 0;
green[1] = 200;
green[2] = 0;
float blue = new float[3];
blue[0] = 0;
blue[1] = 0;
blue[2] = 200;
//Set Background
background(black);
//Draw Lines
//Quadrant 1
stroke(red[0],red[1],red[2]);
strokeWeight(3);
line(0,q1y1,verticalEdge,q1y2);
line(0,q1y3,verticalEdge,q1y4);
line(0,q1y5,verticalEdge,q1y6);
line(0,q1y7,verticalEdge,q1y8);
strokeWeight(1);
line(0,random(400),verticalEdge,random(400));
line(0,random(400),verticalEdge,random(400));
line(0,random(400),verticalEdge,random(400));
//Quadrant 2
stroke(green[0],green[1],green[2]);
strokeWeight(3);
line(q2x1,0,q2x2,horizontalEdge);
line(q2x3,0,q2x4,horizontalEdge);
line(q2x5,0,q2x6,horizontalEdge);
line(q2x7,0,q2x8,horizontalEdge);
strokeWeight(1);
line(random(400)+400,0,random(400)+400,horizontalEdge);
line(random(400)+400,0,random(400)+400,horizontalEdge);
line(random(400)+400,0,random(400)+400,horizontalEdge);
//Quadrant 3
stroke(blue[0],blue[1],blue[2]);
strokeWeight(3);
line (q3x1,q3y1,q3x2,q3y2);
line (q3x3,q3y3,q3x4,q3y4);
line (q3x5,q3y5,q3x6,q3y6);
line (q3x7,q3y7,q3x8,q3y8);
strokeWeight(1);
line (random(400),400,0,random(400)+400);
line (400,random(400)+400,random(400),800);
//Quadrant 4
stroke(white);
strokeWeight(3);
line (q4x1,q4y1,q4x2,q4y2);
line (q4x3,q4y3,q4x4,q4y4);
line (q4x5,q4y5,q4x6,q4y6);
line (q4x7,q4y7,q4x8,q4y8);
strokeWeight(1);
line (random(400)+400,random(400)+400,random(400)+400,random(400)+400);
line (random(400)+400,random(400)+400,random(400)+400,random(400)+400);
line (random(400)+400,random(400)+400,random(400)+400,random(400)+400);
//Update coordinates
//Quadrant 1 line coordinates
q1y1 += random(10)-5;
if (q1y1 > 400)
{
q1y1=400;
}
if (q1y1 <0)
{
q1y1 = 0;
}
q1y2 += random(10)-5;
if (q1y2 > 400)
{
q1y2=400;
}
if (q1y2 <0)
{
q1y2 = 0;
}
q1y3 += random(10)-5;
if (q1y3 > 400)
{
q1y3=400;
}
if (q1y3 <0)
{
q1y3 = 0;
}
q1y4 += random(10)-5;
if (q1y4 > 400)
{
q1y4=400;
}
if (q1y4 <0)
{
q1y4 = 0;
}
q1y5 += random(10)-5;
if (q1y5 > 400)
{
q1y5=400;
}
if (q1y5 <0)
{
q1y5 = 0;
}
q1y6 += random(10)-5;
if (q1y6 > 400)
{
q1y6=400;
}
if (q1y6 <0)
{
q1y6 = 0;
}
q1y7 += random(4)-2;
if (q1y7 > 400)
{
q1y7=400;
}
if (q1y7 <0)
{
q1y7 = 0;
}
q1y8 += random(10)-5;
if (q1y8 > 400)
{
q1y8=400;
}
if (q1y8 <0)
{
q1y8 = 0;
}
//Quadrant 2 line coordinates
q2x1 += random(10)-5;
if (q2x1 < 400)
{
q2x1=400;
}
if (q2x1 >800)
{
q2x1 = 800;
}
q2x2 += random(10)-5;
if (q2x2 < 400)
{
q2x2=400;
}
if (q2x2 >800)
{
q2x2 = 800;
}
q2x3 += random(10)-5;
if (q2x3 < 400)
{
q2x3=400;
}
if (q2x3 >800)
{
q2x3 = 800;
}
q2x4 += random(10)-5;
if (q2x4 < 400)
{
q2x4=400;
}
if (q2x4 >800)
{
q2x4 = 800;
}
q2x5 += random(10)-5;
if (q2x5 < 400)
{
q2x5=400;
}
if (q2x5 >800)
{
q2x5 = 800;
}
q2x6 += random(10)-5;
if (q2x6 < 400)
{
q2x6=400;
}
if (q2x6 >800)
{
q2x6 = 800;
}
q2x7 += random(10)-5;
if (q2x7 < 400)
{
q2x7=400;
}
if (q2x7>800)
{
q2x7 = 800;
}
q2x8 += random(10)-5;
if (q2x8 < 400)
{
q2x8=400;
}
if (q2x8 >800)
{
q2x8 = 800;
}
//Quadrant 3 line coordinates
q3y1 += random(10)-5;
if (q3y1 < 400)
{
q3y1=800;
}
if (q3y1 >800)
{
q3y1 = 400;
}
q3y2 += random(10)-5;
if (q3y2 < 400)
{
q3y2=800;
}
if (q3y2 >800)
{
q3y2 = 400;
}
q3y3 += random(10)-5;
if (q3y3 < 400)
{
q3y3=800;
}
if (q3y3 >800)
{
q3y3 = 400;
}
q3y4 += random(10)-5;
if (q3y4 < 400)
{
q3y4=800;
}
if (q3y4 >800)
{
q3y4 = 400;
}
q3y5 += random(10)-4;
if (q3y5 < 400)
{
q3y5=800;
}
if (q3y5 >800)
{
q3y5 = 400;
}
q3y6 += random(10)-4;
if (q3y6 < 400)
{
q3y6=800;
}
if (q3y6 >800)
{
q3y6 = 400;
}
q3y7 += random(10)-4;
if (q3y7 < 400)
{
q3y7=800;
}
if (q3y7 >800)
{
q3y7 = 400;
}
q3y8 += random(10)-4;
if (q3y8 < 400)
{
q3y8=800;
}
if (q3y8 >800)
{
q3y8 = 400;
}
q3x1 += random(10)-4;
if (q3x1 < 0)
{
q3x1=400;
}
if (q3x1 >400)
{
q3x1 = 0;
}
q3x2 += random(10)-4;
if (q3x2 < 0)
{
q3x2=400;
}
if (q3x2 >400)
{
q3x2 = 0;
}
q3x3 += random(10)-4;
if (q3x3 < 0)
{
q3x3=400;
}
if (q3x3 >400)
{
q3x3 = 0;
}
q3x4 += random(10)-4;
if (q3x4 < 0)
{
q3x4=400;
}
if (q3x4 >400)
{
q3x4 = 0;
}
q3x5 += random(10)-5;
if (q3x5 < 0)
{
q3x5=400;
}
if (q3x5 >400)
{
q3x5 = 0;
}
q3x6 += random(10)-5;
if (q3x6 < 0)
{
q3x6=400;
}
if (q3x6 >400)
{
q3x6 = 0;
}
q3x7 += random(10)-5;
if (q3x7 < 0)
{
q3x7=400;
}
if (q3x7 >400)
{
q3x7 = 0;
}
q3x8 += random(10)-5;
if (q3x8 < 0)
{
q3x8=400;
}
if (q3x8 >400)
{
q3x8 = 0;
}
//Quadrant 4 line coordinates
q4y1 += random(4)-2;
q4y2 += random(4)-2;
q4y3 += random(4)-2;
q4y4 += random(4)-2;
q4y5 += random(4)-2;
q4y6 += random(4)-2;
q4y7 += random(4)-2;
q4y8 += random(4)-2;
q4x1 += random(4)-2;
q4x2 += random(4)-2;
q4x3 += random(4)-2;
q4x4 += random(4)-2;
q4x5 += random(4)-2;
q4x6 += random(4)-2;
q4x7 += random(4)-2;
q4x8 += random(4)-2;
}