/* Mycelium By Ryan Alexander http://onecm.com/ 2005 Adapted For Thomas Feuerstein http://feuerstein.myzel.net/ By Peter Chiochetti http://arton.cunst.net/ 2006 */ Mycelium myc; int fc; // frame counter float fd; // dim factor color black; PImage myFoodImg; String SID; // cookie String URI; // feed location void setup() { size(768, 576, P3D); // connect to image feed // get session id SID = param("SID"); URI = param("URI"); if (URI == null) URI = "http://localhost/Myzel/feed.php"; if (SID == null) { String[] SIDs = new String[1]; SIDs = loadStrings(URI + "/SID"); SID = SIDs[0]; } println("Feed: " + URI + "?" + SID); // initialize mycel myFoodImg = loadImage("start.png"); myc = new Mycelium(myFoodImg); for (int i = 0; i < 10; i++) myc.spore(random(width), random(height), (int)random(20, 50)); fc = 1400; fd = 255./256.; black = color (0,0,0); background(black); framerate(25); } void draw() { // every minute change image if (fc == 1500) { PImage img; print ("Load: "); img = loadImage(URI + "?" + SID); img.filter(OPAQUE); img.filter(GRAY); img.filter(BLUR); myFoodImg.copy(img, 0, 0, img.width, img.height, 0, 0, width, height); String[] NFO = new String[1]; NFO = loadStrings(URI + "/NFO?" + SID); println(NFO[0]); status(NFO[0]); fc = 0; } // update display, dim image loadPixels(); int l = pixels.length; for(int i=fc%25; i