Adding motion effects

edited December 2015 in Library Questions

Hey, How do you add effects in processing? I have a code that takes screenshots every 1second (total 36seconds) from the webcam however, I need to add some effects (wavey things, or smoke or more fun things into it) Hope someone can help This is the code below:

import processing.sound.*; import processing.video.*; SoundFile file;

Capture webcam; PImage image = createImage(66, 66, RGB); long lastTime; int currentImage; int x = 0; PImage[] images = new PImage[36];

void setup(){ fullScreen(); // file = new SoundFile(this, "sample.mp3"); // file.play(); webcam = new Capture( this, width, height ); image(image, 0, 0, width, height); webcam.start(); lastTime = millis(); currentImage = 0; for ( int i = 0; i< images.length; i++ ){
images[i] = createImage( 150, 150, RGB ); } }

void draw(){ if( webcam.available() == true ){ webcam.read(); if( millis() - lastTime >= 800 ){ lastTime = millis(); println( "CAPTURE ", millis() ); if( currentImage <= 35){ images[currentImage].copy( webcam, 0, 0, webcam.width, webcam.height, 0, 0, images[currentImage].width, images[currentImage].height ); currentImage = currentImage + 1; //currentImage = 0; } println( currentImage + 1); } for(int i = 0; i < 6; i++ ) { for(int j = 0; j < 6; j++ ) { image(images[j + i6], 150j, 150*i ); } } if (x < 100) { line(x, 0, x, 100); x = x + 1; } //void mousePressed() { // if (mouseButton == LEFT) { // webcam.start(); // } else if (mouseButton == RIGHT) { // webcam.stop(); // } //if (mousePressed && (mouseButton == LEFT)) { //webcam.start(); }// else if (mousePressed && (mouseButton == RIGHT)) { // webcam.stop(); //} //} }

Sign In or Register to comment.