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.

PROCESSING: CREATIVE CODING AND COMPUTATIONAL ART<br />

546<br />

* Making Things Move!<br />

* http://www.friendsofed.com/book.html? ➥<br />

* isbn=1590597915<br />

*******************************************/<br />

// orbCount minimum is 2<br />

int orbCount = 140;<br />

Orb[] orb = new Orb[orbCount];<br />

Vect2D[] velocity = new Vect2D[orbCount];<br />

color[] cols = new color[orbCount];<br />

float[] damping = new float[orbCount];<br />

float gravity = .03;<br />

float sprayRadius = .3;<br />

float birthRate = .4;<br />

float emitter = 0;<br />

float dampingMin = .5, dampingMax = .85;<br />

// min of 6 segments required<br />

int segments = 200;<br />

Ground[] ground = new Ground[segments];<br />

float[] peakHeights = new float[segments+1];<br />

// controls ground undulation<br />

float groundTexture = 3.5;<br />

// earth image map<br />

PImage p;<br />

// stars<br />

int starCount = 500;<br />

Point[] stars = new Point[starCount];<br />

void setup(){<br />

size(400, 400, P3D);<br />

// load image map<br />

p = loadImage("earth.png");<br />

// stars<br />

for (int i=0; i

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

Saved successfully!

Ooh no, something went wrong!