/**
Cube Monster by Eduardo Omine [2008-11-16]
http://blog.omine.net/

Move the mouse and the monster will follow.
Click anywhere to change its behaviour.
*/ float FOV = HALF_PI * 0.5; Monster monster; void setup() { size(400, 400, P3D); frameRate(60); cursor(HAND); monster = new Monster(); } void draw() { background(255); camera(200, 200, 500, 200, 200, 0, 0, 1, 0); perspective(FOV, 1, 1, 400); monster.update(); monster.draw(); } void mousePressed() { monster.toggleAngry(); } void drawBox(float x, float y, float z, float sx, float sy, float sz) { pushMatrix(); translate(x, y, z); box(sx, sy, sz); popMatrix(); } void drawBox(float x, float y, float z, float sx, float sy, float sz, float a) { pushMatrix(); translate(x, y, z); rotateZ(a); box(sx, sy, sz); popMatrix(); }