Adding four elusive examples for 2.0

This commit is contained in:
Casey Reas
2011-09-23 04:30:49 +00:00
parent 761dc861a2
commit 40a75b2bbe
4 changed files with 147 additions and 0 deletions
@@ -0,0 +1,31 @@
/**
* On/Off.
*
* Uses the default lights to show a simple box. The lights() function
* is used to turn on the default lighting. Click the mouse to turn the
* lights off.
*/
float spin = 0.0;
void setup() {
size(640, 360, P3D);
noStroke();
}
void draw() {
background(51);
if (!mousePressed) {
lights();
}
spin += 0.01;
pushMatrix();
translate(width/2, height/2, 0);
rotateX(PI/9);
rotateY(PI/5 + spin);
box(150);
popMatrix();
}