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

374<br />

Tessellation<br />

innerRad-=4.25;<br />

fill(fillCol);<br />

fillCol-=fillfade;<br />

angle+=rot;<br />

}<br />

endShape();<br />

Figure 9-26. TRIANGLE_STRIP Spiral sketch<br />

Another interesting thing you can do with these functions is create a tessellation. A<br />

tessellation is a pattern of shapes that fit together, without any gaps, covering a surface.<br />

For more of a definition, have a look at what Wikipedia has to say about tessellations, at<br />

http://en.wikipedia.org/wiki/Tessellation. TRIANGLE_FAN mode is a little tricky, as it<br />

needs to rotate clockwise, <strong>and</strong> the initial point should define the center part of the fan. In<br />

3D, forms are commonly converted to <strong>and</strong>/or rendered as triangle meshes. TRIANGLE_FAN<br />

mode is a somewhat convenient function for triangulating planar geometry. Triangulating<br />

means converting a larger polygon into triangles, which is a form of tessellation. Since triangles<br />

are always planar <strong>and</strong> simple (with regard to polygons—not a commentary on their<br />

intelligence), they are easier for the computer to render than quadrilaterals. This mode

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

Saved successfully!

Ooh no, something went wrong!