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.

float spin = 0;<br />

void setup(){<br />

size(400, 400);<br />

background(0);<br />

smooth();<br />

fade = 255.0/(width/2.0/shift);<br />

spin = 360.0/(width/2.0/shift);<br />

p[0] = new Point(-width/2, height/2);<br />

p[1] = new Point(width/2, height/2);<br />

p[2] = new Point(0, -height/2);<br />

noStroke();<br />

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

triBlur();<br />

}<br />

void triBlur(){<br />

fill(fillCol);<br />

fillCol+=fade;<br />

rotate(spin);<br />

// another interesting variation: uncomment the line below<br />

// rotate(rot+=radians(spin));<br />

triangle(p[0].x+=shift, p[0].y-=shift/2, p[1].x-=shift, ➥<br />

p[1].y-=shift/2, p[2].x, p[2].y+=shift);<br />

if(p[0].x

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

Saved successfully!

Ooh no, something went wrong!