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.

the time to play at whatever level you are at. This is a really important approach that<br />

teachers are sometimes lousy at implementing. It is easy to get caught up in teaching the<br />

pursuit of mastery, focusing on achievement goals for students <strong>and</strong> checking off the requisite<br />

material covered. The school system reinforces this approach with st<strong>and</strong>ardized testing,<br />

creating crammers <strong>and</strong> compartmentalizers who separate work <strong>and</strong> play, craft from<br />

art. Is it any wonder that many of us (especially creative types) felt bored <strong>and</strong> frustrated in<br />

the traditional classroom, especially in subjects that required methodical drilling or rote<br />

memorization (like math)? Sadly, as we get older, we eventually label these subjects as the<br />

problem, not the non-integrated teaching approaches. My experience in the classroom has<br />

been that I find most people receptive to learning anything when it’s taught effectively.<br />

And my vision of effective teaching always involves finding a way of integrating aspects of<br />

play <strong>and</strong> work into the learning process. Before I launch into yet another whiny soliloquy,<br />

I’ll sum it up with the following: real code art (whatever the heck that means) can be<br />

made at any level—by a newbie coder learning the basics or a seventh-degree Java black<br />

belt—<strong>and</strong> happy coding mistakes help us see the expressive possibilities at whatever level<br />

we are at.<br />

Before I end this chapter, I think it might be helpful to illustrate this point with a short<br />

example of how I approach happy coding mistakes in my own process.<br />

Algorithmic tree<br />

I used to paint a lot of trees. Originally, I painted the entire l<strong>and</strong>scape, but gradually over<br />

time, I found myself zooming in closer on the trees, until one summer, I painted an entire<br />

series of large paintings based on part of one tree. It is interesting watching your neighbors’<br />

reactions as you spend more <strong>and</strong> more time st<strong>and</strong>ing in your backyard, staring up at<br />

the same tree.<br />

So in honor of my favorite tree, I thought I’d illustrate some creative coding by generating<br />

a tree with code. Let me also preface this by saying that you shouldn’t try to follow this<br />

code unless you already know how to program; it may seem totally overwhelming. My<br />

main point here is to reveal my creative process, not to teach the code; the rest of the<br />

book is for that. Feel free to run this sketch <strong>and</strong> make changes to the code to see what<br />

happens. If you get any really cool results, I hope you’ll e-mail me some screenshots.<br />

In considering the problem, I decided to think about trees some <strong>and</strong> to break the problem<br />

down into simple parts. In a moment of brilliant clarity, I concluded that trees have a<br />

trunk, branches, <strong>and</strong> leaves. OK, I know I can probably make a trunk (think straight vertical<br />

line). Branches could be a little harder, <strong>and</strong> leaves, well, probably too hard (actually too<br />

much work). Branches, I concluded, could be simplified as a thin trunk, splitting off to<br />

another series of thinner trunks, splitting off to another series of thinner trunks, <strong>and</strong> so on.<br />

Thus, it seemed branches could be made from a single branch machine, in a fractal progression<br />

(huh?). By fractal progression, I mean the branches are self-similar <strong>and</strong> repeat.<br />

Each branch’s ending point is a starting point for more branches, with a decreasing scale.<br />

Thus, the tree thickness decreases from trunk to branch—which seemed pretty consistent<br />

with real trees. I decided to put the leaves on hold for now. I was ready for a little sketch<br />

of my branch plan (see Figure 2-2).<br />

CREATIVE CODING<br />

45<br />

2

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

Saved successfully!

Ooh no, something went wrong!