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.

arrays. The x <strong>and</strong> y values don't change between planes.<br />

The extruded z values are calculated in extrude function<br />

*/<br />

float[][]inputArray = {<br />

{verticesX[0], verticesX[1], verticesX[2], verticesX[3]},<br />

{verticesY[0], verticesY[1], verticesY[2], verticesY[3]},<br />

{verticesZ[0], verticesZ[1], verticesZ[2], verticesZ[3]}<br />

};<br />

// add new segment to vertices array, using<br />

// <strong>Processing</strong>'s splice() function<br />

verticesX = splice(verticesX, inputArray[0], verticesX.length);<br />

verticesY = splice(verticesY, inputArray[1], verticesY.length);<br />

verticesZ = splice(verticesZ, inputArray[2], verticesZ.length);<br />

}<br />

void extrude(){<br />

// Calculate z positions of vertices<br />

float segmentWidth = extrudeLength/segments;<br />

for (int i=0; i

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

Saved successfully!

Ooh no, something went wrong!