Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Really simple blending of webcam frames for light painting/POV leds etc.
- //For processing 3.0 +, may require edits for older versions.
- //Should show 'trails' from light sources for several frames
- //And pictures from light painting gear or POV leds
- //By devicer.net
- //do whatever you like with this code, it's only a basic start :)
- import processing.video.*;
- Capture video;
- int fadeValue = 5; //lower = longer tail, 0 to disable...
- void setup() {
- size(640, 480);
- // Uses the default video input, see the reference if this causes an error
- video = new Capture(this, width, height);
- video.start();
- noStroke();
- smooth();
- blendMode(LIGHTEST);
- background(0);
- }
- void draw() {
- if (video.available()) {
- video.read();
- blendMode(LIGHTEST);//can also use ADD for additive and possibly SCREEN too, see blendMode() reference.
- image(video, 0, 0, width, height); // Draw webcam frame (with lightest blending)
- blendMode(BLEND); //crude but it works...!
- fill(0,fadeValue);
- rect(0, 0, width, height);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement