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.

otate around Y <strong>and</strong> X axes<br />

rotateY(rotY+=.05);<br />

rotateX(rotX+=.1);<br />

// mouse x position controls level<br />

// of detail of sphere geometry<br />

sphereDetail(mouseX/32);<br />

fill(0);<br />

stroke(255);<br />

//draw sphere<br />

sphere(30);<br />

fill(50, 50, 50, 175);<br />

noStroke();<br />

//draw box<br />

box(80);<br />

noFill();<br />

sphereDetail(8);<br />

stroke(0);<br />

// draw larger outer sphere<br />

sphere(80);<br />

}<br />

Figure 5-13. Screen capture of the Rotating Polyhedra sketch<br />

THE PROCESSING ENVIRONMENT<br />

165<br />

5

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

Saved successfully!

Ooh no, something went wrong!