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.

PROCESSING: CREATIVE CODING AND COMPUTATIONAL ART<br />

664<br />

void setup(){<br />

size(400, 400, P3D);<br />

}<br />

void draw(){<br />

background(50, 64, 42);<br />

// basic lighting setup<br />

lights();<br />

// 2 rendering styles<br />

// wireframe or solid<br />

if (isWireFrame){<br />

stroke(255, 255, 150);<br />

noFill();<br />

}<br />

else {<br />

noStroke();<br />

fill(150, 195, 125);<br />

}<br />

//center <strong>and</strong> spin toroid<br />

translate(width/2, height/2);<br />

rotateX(frameCount*PI/150);<br />

rotateY(frameCount*PI/170);<br />

rotateZ(frameCount*PI/90);<br />

// initialize point arrays<br />

vertices = new Point3D[pts+1];<br />

vertices2 = new Point3D[pts+1];<br />

// fill arrays<br />

for(int i=0; i

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

Saved successfully!

Ooh no, something went wrong!