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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PROCESSING: CREATIVE CODING AND COMPUTATIONAL ART<br />

676<br />

In this appendix, you will find a h<strong>and</strong>y reference to all aspects of the <strong>Processing</strong> language,<br />

including many code examples to help you out <strong>and</strong> give you inspiration. This is the place<br />

to come first if you want to quickly look up anything covered throughout the rest of<br />

the book.<br />

Since there’s already an official reference available online <strong>and</strong> within your <strong>Processing</strong><br />

installation, you might ask why I’ve written this appendix. Well, my intention was to<br />

exp<strong>and</strong> upon the more challenging concepts in the official reference, as well as<br />

include many additional code examples.<br />

Introducing the <strong>Processing</strong> API<br />

The <strong>Processing</strong> API is the reference for the core <strong>Processing</strong> language. This is the place to<br />

look up a specific <strong>Processing</strong> comm<strong>and</strong>. The <strong>Processing</strong> API lives online at http://<br />

processing.org/reference/index.html, <strong>and</strong> a copy of it is also installed within your local<br />

<strong>Processing</strong> application directory on your computer. The API is HTML-based with crossreferenced<br />

links throughout. There are also additional libraries available to <strong>Processing</strong> that<br />

extend the language. The library reference is not included in the core language API.<br />

The <strong>Processing</strong> core API can be viewed four different ways:<br />

Abridged<br />

Abridged (A–Z)<br />

Complete<br />

Complete (A–Z)<br />

According to a blurb on the language reference page, the abridged reference “omits<br />

description <strong>and</strong> functions for drawing in 3D <strong>and</strong> for detailed drawing <strong>and</strong> data manipulation.”<br />

The abridged <strong>and</strong> complete options (bullets 1 <strong>and</strong> 3) break the language down into<br />

logical segments relating to basic comm<strong>and</strong> functionality. The two “A–Z” options lay the<br />

language out alphabetically. Personally, I find the segmentation of the API by function<br />

easier to work with.<br />

When you launch the reference site, the abridged viewing option is initially loaded.<br />

However, since in this chapter I’ll be discussing the complete API, you might want to select<br />

the complete option at first (before sending an angry e-mail to the publisher). To all you<br />

new coders, you don’t need to work with the entire API to use <strong>Processing</strong>. A lot of really<br />

interesting things can be done with minimal amounts of code, using only a fraction of the<br />

API. As you progress, though, you’ll naturally begin to use more <strong>and</strong> more of the API, so<br />

don’t worry about trying to cram or memorize all this stuff.<br />

As I mentioned, it doesn’t make a lot of sense to me to re-create the entire API in this<br />

book when it is free to use, well organized, <strong>and</strong> easily accessible—both locally <strong>and</strong> at

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

Saved successfully!

Ooh no, something went wrong!