04.04.2013 Views

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

call scribble function<br />

strokeWeight(.5);<br />

if (i>0){<br />

scribble(pts[0][i], pts[1][i], pts[0][i-1], pts[1][i-1], ➥<br />

steps, scribVal, SCRIBBLE);<br />

}<br />

if (i== pts[0].length-1){<br />

// show some hatching between last 2 points<br />

scribble(pts[0][i], pts[1][i], pts[0][0], pts[1][0], steps, ➥<br />

scribVal*2, HATCHING);<br />

}<br />

}<br />

}<br />

/*<br />

scribble function plots lines between end points,<br />

determined by steps <strong>and</strong> scribVal arguments.<br />

2 styles are available: SCRIBBLE <strong>and</strong> HATCHING, which<br />

are interestingly only dependent on parentheses<br />

placement in the line() function calls.<br />

*/<br />

void scribble(float x1, float y1, float x2, float y2, int steps, ➥<br />

float scribVal, int style){<br />

float xStep = (x2-x1)/steps;<br />

float yStep = (y2-y1)/steps;<br />

for (int i=0; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!