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.

PROCESSING: CREATIVE CODING AND COMPUTATIONAL ART<br />

688<br />

/*Simple Poly class, plots any<br />

regular polygon*/<br />

class Poly {<br />

int sides;<br />

float r1, r2;<br />

float angle;<br />

Poly(int sides, int r1, int r2, float initAng){<br />

this.sides = sides;<br />

this.r1 = r1;<br />

this.r2 = r2;<br />

angle = initAng;<br />

}<br />

void drawPoly(int cx, int cy){<br />

noStroke();<br />

fill(cy, cx, 100);<br />

float px= 0, py = 0;<br />

beginShape();<br />

for (int i=0; i

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

Saved successfully!

Ooh no, something went wrong!