07.01.2013 Views

Fractal.Invaders, Substrate (Interview with Jared Tarbell) - Processing

Fractal.Invaders, Substrate (Interview with Jared Tarbell) - Processing

Fractal.Invaders, Substrate (Interview with Jared Tarbell) - Processing

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.

207 Input 1: Mouse I<br />

// Multiply and divide to creates scaling offsets<br />

void setup() {<br />

size(100, 100);<br />

smooth();<br />

noStroke();<br />

}<br />

void draw() {<br />

background(126);<br />

ellipse(mouseX, 16, 33, 33); // Top circle<br />

ellipse(mouseX/2, 50, 33, 33); // Middle circle<br />

ellipse(mouseX*2, 84, 33, 33); // Bottom circle<br />

}<br />

// Invert cursor position to create a secondary response<br />

void setup() {<br />

size(100, 100);<br />

noStroke();<br />

smooth();<br />

}<br />

void draw() {<br />

float x = mouseX;<br />

float y = mouseY;<br />

float ix = width - mouseX; // Inverse X<br />

float iy = mouseY - height; // Inverse Y<br />

background(126);<br />

fill(255, 150);<br />

ellipse(x, height/2, y, y);<br />

fill(0, 159);<br />

ellipse(ix, height/2, iy, iy);<br />

}<br />

23-04<br />

23-05

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

Saved successfully!

Ooh no, something went wrong!