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.

calc. damping based on strokeWeight<br />

// simulates resistance of spring thickness<br />

switch(round(strokeWt[i])){<br />

case 1:<br />

damping[i] = .99;<br />

break;<br />

case 2:<br />

damping[i] = .98;<br />

break;<br />

case 3:<br />

damping[i] = .97;<br />

break;<br />

case 4:<br />

damping[i] = .96;<br />

break;<br />

}<br />

}<br />

}<br />

//plot spring<br />

void createSpring(float x, float y, float w, float h, float strokeWt){<br />

stroke(50);<br />

strokeWeight(strokeWt);<br />

for (int i=0; i

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

Saved successfully!

Ooh no, something went wrong!