import JMyron.*; float inc; int counter; float numStripes; JMyron m; PImage image1 = new PImage(640, 480), image2 = new PImage(640, 480), image3 = new PImage(640, 480); String savePath = "/Users/shawnbarr/Documents/Processing/StructuredLight/PatternCam/"; void setup(){ //println(Capture.list()); size(1024,768); m = new JMyron(); m.start(640,480); //myCapture = new Capture(this, 320, 240, "IIDC FireWire Video", 30); frameRate(30); counter = 0; numStripes = 20.0; inc = TWO_PI / height * numStripes; } void draw(){ counter++; float offset = (counter % 3) * height / numStripes / 3.0 ; for(int y=0; y < height; y++){ stroke(sin((y + offset) * inc ) * 128.0 + 128); line (0, y, width, y); } m.update(); if (counter == 4) { m.imageCopy(image1.pixels); } if (counter == 5) m.imageCopy(image2.pixels); if (counter == 6) m.imageCopy(image3.pixels); if (counter == 7) { image1.save(savePath + "image1.png"); image2.save(savePath + "image2.png"); image3.save(savePath + "image3.png"); } println("Draw = " +counter); }