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 />

734<br />

}<br />

// avoid infinite loop<br />

// Zeno's paradox waiting to happen<br />

if (w>5){<br />

w*=.81;<br />

h*=.81;<br />

}<br />

}<br />

Figure A-17. Progressive Tile sketch<br />

Rendering<br />

This section includes the PGraphics data type <strong>and</strong> the createGraphics() function.<br />

Together, these elements provide low-level access into <strong>Processing</strong>’s graphics <strong>and</strong> rendering<br />

context—sort of the meat (or tempeh, for vegan readers) <strong>and</strong> potatoes of the <strong>Processing</strong><br />

API. PGraphics is one of <strong>Processing</strong>’s core, base classes, <strong>and</strong> it has a rich set of properties<br />

<strong>and</strong> methods, which you can learn more about at http://dev.processing.org/<br />

reference/core/javadoc/processing/core/PGraphics.html. One of the main uses for

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

Saved successfully!

Ooh no, something went wrong!