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.

Example 3: Creating a honeycomb gradient<br />

/*<br />

HoneyComb<br />

Ira Greenberg, November 6, 2005<br />

*/<br />

// total polys<br />

int polyCount;<br />

// poly array<br />

Poly[]pols;<br />

// I created 2 radii to allow asymmetry<br />

int rad1 = 10, rad2 = 10;<br />

// change poly orientation<br />

float initAng = 0;<br />

void setup(){<br />

size(400, 400);<br />

background(255);<br />

/* 1 extra cell is added to each row <strong>and</strong><br />

column to allow the honeycomb to bleed<br />

off the display window */<br />

polyCount = (width/(rad1*2) + 1) * (height/(rad2*2) + 1);<br />

//create Poly array<br />

pols = new Poly[polyCount];<br />

for (int i=0; i

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

Saved successfully!

Ooh no, something went wrong!