import processing.opengl.*; RGBColor[] colors; String[] lines; void setup () { size(1000,1000, OPENGL); lights(); int num = 10* (int) random(10)+20; colors = new RGBColor[num]; for(int i = 0; i < num; i++) { colors[i] = new RGBColor((int) random(255), (int) random(255), (int) random(255)); } // cheating quine lines = loadStrings("../sketch_080527a.pde"); PFont font = createFont("VeraMoBd.ttf", 18); textFont(font); } void draw () { frameRate(15); if(mousePressed) { camera(mouseX,0.0f, mouseY, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f); } for(int i = 0; i < colors.length; i++ ) { pushMatrix(); translate(colors[i].r, colors[i].g, colors[i].b); fill(colors[i].r, colors[i].g, colors[i].b); sphere(20); popMatrix(); } } // hint: hold down the 'e' key to move color matrix around space void keyPressed() { if(key == 'e') { background(128); fill(0); camera(); for(int i = 0; i < lines.length; i++) { text(lines[i],250, i*18+18, 0); } } } class RGBColor { int r; int g; int b; RGBColor (int r, int g, int b) { this.r = r; this.g = g; this.b = b; } }