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.

Figure 9-3. ellipseMode() example<br />

This next example is the earlier rectMode example converted to draw ellipses (see<br />

Figure 9-4). I left in the rect() calls, treating them as bounding boxes around the ellipses.<br />

//Ellipses with Bounding Boxes<br />

void setup(){<br />

size(400, 400);<br />

background(255);<br />

strokeWeight(10);<br />

fill(127);<br />

ellipse(103, 120, 130, 100);<br />

ellipseMode(CORNER);<br />

ellipse(103, 120, 130, 100);<br />

ellipseMode(CORNERS);<br />

ellipse(233, 220, 363, 320);<br />

// bounding boxes<br />

strokeWeight(1);<br />

noFill();<br />

rect(103, 120, 130, 100);<br />

rectMode(CENTER);<br />

rect(103, 120, 130, 100);<br />

rectMode(CORNERS);<br />

rect(233, 220, 363, 320);<br />

}<br />

SHAPES<br />

343<br />

9

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

Saved successfully!

Ooh no, something went wrong!