I'd like to do something like fjen's diagonal striped rect but with polygons.
http://snippet.seltar.org/index.php?pid=3&sid=15
I've gotten entertaining results out of it but not the diagonal polygon bands I was hoping for. This effort is to generate a pdf file for a background to a game. Here's how far I've gotten:
Code:
void setup ()
{
size( 200, 200 );
}
void draw ()
{
background(200);
int x = 20, y=20, w=width-40, h=height-40;
//stroke( 0xFFFF9900 ); noFill();
for ( int ss = 15; ss < w+h ; ss += 15 )
{
//stroke( ss > h ? (ss > w ? 0xFF00FF00 : 0xFFFF0000) : 0 );
/* line( ss <= h ? x : x-h+ss,
ss <= h ? y+ss : y+h,
ss <= w ? x+ss : x+w,
ss <= w ? y : y-w+ss
);*/
beginShape();
vertex(ss <= h ? x : x-h+ss, ss <= h ? y+ss : y+h);
vertex(ss <= w ? x+ss : x+w, ss <= w ? y : y-w+ss);
vertex(ss + 15 <= w ? x+ss+15 : x+w, ss <= w ? y : y-w+ss+15);
vertex(ss + 15 <= h ? x : x-h+ss + 15, ss <= h ? y+ss+15 : y+h);
endShape();
}
}
I haven't got a clue on how to change this code to produce thick diagonal stripes (strokeWeight not an option). Can anyone help me please?