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.

curveVertex(92+x, 15);<br />

curveVertex(92+x, 15);<br />

curveVertex(134+x, 15);<br />

curveVertex(175+x, 50);<br />

curveVertex(175+x, 175);<br />

curveVertex(75+x, 175);<br />

curveVertex(75+x, 75);<br />

curveVertex(150+x, 75);<br />

curveVertex(150+x, 150);<br />

curveVertex(100+x, 150);<br />

curveVertex(100+x, 150);<br />

endShape();<br />

//control h<strong>and</strong>les<br />

strokeWeight(1);<br />

fill(255);<br />

ellipse(92+x, 15, 8, 8);<br />

ellipse(134+x, 15, 8, 8);<br />

ellipse(175+x, 50, 8, 8);<br />

ellipse(175+x, 175, 8, 8);<br />

ellipse(75+x, 175, 8, 8);<br />

ellipse(75+x, 75, 8, 8);<br />

ellipse(150+x, 75, 8, 8);<br />

ellipse(150+x, 150, 8, 8);<br />

ellipse(100+x, 150, 8, 8);<br />

Figure 7-33. curve() vs. curveVertex() sketch<br />

I think the curveVertex() function is less work to use than curve(). Obviously, having to<br />

deal with two arguments is definitely better than eight. From bezier() to bezierVertex(),<br />

you go from eight to six arguments, so I’m not so sure for normal open paths if there is<br />

much advantage. For closed or fill paths, you’ll want to use bezierVertex() or<br />

curveVertex(). Although you can fill individual bezier() <strong>and</strong> curve() curves, the fill<br />

won’t span multiple connected curve segments. To see an example of this, replace the<br />

noFill() call with fill(127) before the first spiral code in either of the last two<br />

examples.<br />

CURVES<br />

289<br />

7

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

Saved successfully!

Ooh no, something went wrong!