Jump to content

Visualize feedback loops in Processing

0
  odewahn1's Photo
Posted May 07 2010 12:22 PM

Feedback loops are closely associated with recursion, and are basically systems where the output signal from the system is fed back in as the input. This leads to all sorts of surprising and unpredictable behaviors. (Although chaos theory and other branches of math dedicated to modeling uncertainty have tried to untangle them). This Answer will show you a quick way to visualize feedback loops using processing.

The method is simple: just hook up an external camera to your machine and point it at the output of the script at the end of this Answer:

Attached Image

You'll see something that looks like this: note the psychedelic swirls and multiple copies, all of which come solely from the feedback effects of the video. (Moving the camera around creates a cool twisting effect.)




Here's the script:

import processing.video.*;
Capture myCapture;

void setup() 
{
 size(800, 600);
 myCapture = new Capture(this, width, height, 30);
}

void captureEvent(Capture myCapture) {
 myCapture.read();
}

void draw() {
 image(myCapture, 0, 0);
}


Getting Started with Processing

Learn more about this topic from Getting Started with Processing.

Learn computer programming the easy way with Processing, a simple language that lets you use code to create drawings, animation, and interactive graphics. Programming courses usually start with theory, but this book lets you jump right into creative and fun projects. It's ideal for anyone who wants to learn basic programming, and serves as a simple introduction to graphics for people with some programming skills.

See what you'll learn


Tags:
0 Subscribe


0 Replies