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.

system, you can try lowering the resolution of the images (in an image editing program),<br />

lowering the value of the bldgCount variable in the sketch, or buying yourself a new computer.<br />

If you go with option 3, I’ll take a new Mac laptop while you’re at it.<br />

/*<br />

FlyThrough<br />

Ira Greenberg, November 8, 2005<br />

*/<br />

/*Need to import opengl library to use OPENGL<br />

rendering mode. You can also try running<br />

in P3D mode*/<br />

import processing.opengl.*;<br />

// images used for mapping<br />

PImage ground, brick;<br />

// camera move variables<br />

float bank=2;<br />

float bankAngle;<br />

float bankSpeed = .7;<br />

float vert = -600;<br />

float zoom;<br />

float vertSpeed = 1.5;<br />

float heading;<br />

float headingSpeed = -.75;<br />

float pitch;<br />

float pan;<br />

float zoomSpeed = 1.6;<br />

//structures<br />

int bldgCount = 300;<br />

BLDG[]bldgs = new BLDG[bldgCount];<br />

BLDG plane;<br />

void setup(){<br />

size(600, 400, OPENGL);<br />

noStroke();<br />

textureMode(NORMALIZED);<br />

//load image maps<br />

ground = loadImage("ground2.jpg");<br />

brick = loadImage("metal2.jpg");<br />

//set up ground plane<br />

plane = new BLDG(width*10, 0, width*10, 0, 60, 0, ground);<br />

// instantiate bldgs<br />

for (int i=0; i

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

Saved successfully!

Ooh no, something went wrong!