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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

You should notice some familiar structures in this example. I called the smooth() function<br />

to turn on anti-aliasing, <strong>and</strong> I used two while loops nested within a conditional if...else<br />

structure to ensure that the line stays in the display window. Try changing the values of the<br />

deltaX <strong>and</strong> deltaY variables to see how the diagonal changes (see Figures 7-3 <strong>and</strong> 7-4 for<br />

a couple of examples).<br />

deltaX = .7;<br />

deltaY = 1.2;<br />

deltaX = 1.4;<br />

deltaY = .2;<br />

Figure 7-3. A more vertical diagonal<br />

Figure 7-4. A more horizontal diagonal<br />

CURVES<br />

245<br />

7

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

Saved successfully!

Ooh no, something went wrong!