/** * Inspiration #2 * d'apres la musique Nara, de Ex Posthumus * * http://oroooroo.blogspot.com/2009/02/inspiration-partie-2-billet.html * * Par Xavier GOUCHET, 2009 * http://www.xgouchet.fr/blog/ * */ boolean debug = false; float px, py; int ix, iy; float dx, dy; int g = 50; float s = 30; float angle = 0; color fogcolor = color(0,0,16); void setup(){ size(640, 480, P3D); px = 0; py = 0; } void draw() { background(fogcolor); if (debug){ stroke(255); noFill(); } else { noStroke(); } // Mouse Nav float dmx = (mouseX - (width/2)) * 0.001; angle += dmx*0.05; // Speed px += sin(angle) * 0.1; py -= cos(angle) * 0.1; ix = (int) Math.floor(px); iy = (int) Math.floor(py); dx = ix - px; dy = iy - py; pushMatrix(); //lights(); translate(width*0.5 , height*0.65, g*s); rotateZ(-dmx*0.5); //rotateX(-dmy); rotateX(-0.05); rotateY(angle); renderGrid(); renderWater(); popMatrix(); } void renderGrid(){ noiseDetail(1,0); for (int i=-g; i