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

672<br />

Summary<br />

<strong>Coding</strong> 3D, long the domain of hardcore programmers, is now accessible to the rest of us,<br />

thanks to <strong>Processing</strong>. One of the main difficulties in coding 3D has simply been getting<br />

started. Most books on the subject are geared toward computer scientists, mathematicians,<br />

<strong>and</strong> engineers, <strong>and</strong> are filled with scary diagrams <strong>and</strong> equations. Just getting a simple,<br />

static cube (a 3D primitive) on the screen can be an ordeal. This is not the case with<br />

<strong>Processing</strong>, as the simple, ten-line rotating cube sketch at the beginning of the chapter<br />

revealed. Using <strong>Processing</strong>’s h<strong>and</strong>y pushMatrix() <strong>and</strong> popMatrix() functions, as shown in<br />

the previous brick tower example, you can also easily construct more complex structures,<br />

combining simple 3D primitives.<br />

This chapter went beneath the surface as well, revealing the usefulness of the same old<br />

basic trig functions you’ve been using throughout the book. You created your own<br />

Point3D, Cube, <strong>and</strong> SpinnyCube classes, with which you created a custom multicolored<br />

cube <strong>and</strong> even coded your own 3D rotations. Building upon these classes with some simple<br />

algorithms, you generated a larger set of 3D primitives, including a pyramid, cone,<br />

cylinder, toroid, <strong>and</strong> helix; <strong>and</strong> you explored how these forms are related through a few<br />

interactive sketches. Finally, you learned some 3D optimization techniques <strong>and</strong> looked at<br />

<strong>Processing</strong>’s sphereDetail() function.

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

Saved successfully!

Ooh no, something went wrong!