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 />

722<br />

bldgs[i] = new BLDG(10+r<strong>and</strong>om(30), r<strong>and</strong>om(100, 840), 10+r<strong>and</strong>om(50),<br />

r<strong>and</strong>om(-width*2, width*2), 60, r<strong>and</strong>om(-width*3, width*2), brick);<br />

}<br />

}<br />

void draw(){<br />

background(4, 4, 20);<br />

// set camera <strong>and</strong> lights<br />

camera(width/2.0+pan, height/2+vert, ((height/2.0+1500-zoom) /<br />

tan(PI*60 / 360.0)), width/2.0+pan, height/2+vert, -8000, 0, 1, 0);<br />

fill(200);<br />

//set up some different colored lights<br />

ambientLight(90, 65, 52);<br />

pointLight(51, 102, 255, width/3, height/2, 100);<br />

pointLight(200, 40, 60, width/1.5, height/2, -150);<br />

pointLight(20, 220, 25, -200, -100, 300);<br />

pointLight(110, 55, 40, width*4, height/2, 1000);<br />

//draw ground plane<br />

pushMatrix();<br />

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

rotateY(radians(heading));<br />

rotateX(radians(pitch));<br />

rotateZ(radians(bank));<br />

plane.drawBLDG();<br />

// draw buildings<br />

for (int i=0; i

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

Saved successfully!

Ooh no, something went wrong!