I am trying to construct a definition that has 3 lines that meet at a single point, while the other ends continue to one of the 4 edges of the screen. I have constructed the script below, such that this is accomplished with 3 shapes, whose definition is achieved by describing the points they pass through. I can only get the defining vertices to occur on 3 sides. I am trying to allow for the end points to occur on all 4 sides of the screen. I am looking for a way to insert an 'either/or' instruction which will allow the script to randomly select which edge the endpoint happens on. It is entirely possible that I am approaching the problem incorrectly, but as this is my first ever attempt at any scripting, I am pleased to have accomplished this. I would be very grateful for any help provided. Thanks in advance for the help.
R. Mantho
float a = 0;
float b = 595;
float c = 900;
float d = random(100,495);
float e = random(200,700);
float f = random(100,495);
float g = random(200,700);
float h = random(100,495);
float i = random(200,700);
{size(595, 900);
stroke(0);
beginShape();
vertex(a,a);
vertex(d,a);
vertex(h,i);
vertex(a,g);
endShape(CLOSE);
beginShape();
vertex(b,a);
vertex(b,c);
vertex(f,c);
vertex(h,i);
vertex(d,a);
endShape(CLOSE);
beginShape();
vertex(a,c);
vertex(a,g);
vertex(h,i);
vertex(h,i);
vertex(f,c);
endShape(CLOSE);