/** FeedbackDemo.pde
Dave Bollinger Jun 2007
http://www.davebollinger.com

Usage: move the mouse to reposition source image.
'1' : zoom in (trails fly out) [default]
'2' : zoom out (trails fly in)
'3' : roto-zoom in (spinning trails fly out)
'4' : roto-zoom out (spinning trails fly in)
'5' : motion blur effect
'6' : wiggle roto-zoom in (wiggly trails fly out)
'7' : wiggle roto-zoom out (wiggly trails fly in)
'8' : wobble roto-zoom in (wobbly trails fly out)
'9' : wobble roto-zoom out (wobbly trails fly in)
'0' : wiggle wobble roto-zoom in (wiggly wobbly trails fly out)

"wiggle" animates the "roto" value - if this were real camera-based feedback
it would be like quickly twisting the camera relative to the screen.

"wobble" animates the "zoom" value - if this were real camera-based feedback
it would be like quickly shaking the camera back-and-forth relative to the screen.

*/ //import processing.opengl.*; MouseImage src; // the "source" image FeedbackEffects fbfx; // the feedback texturizer void setup() { // size(256,256,OPENGL); size(256,256,P3D); src = new MouseImage("feedback.gif"); fbfx = new FeedbackEffects(this, 0f, 1.05f, 240f); } void draw() { background(0); fbfx.draw(); // draw the feedback texture as background src.draw(); // draw new source material fbfx.grab(); // grab frame as texture for next frame } void keyPressed() { switch(key) { case '1' : fbfx.config(0f, 1.05f, 240f); break; case '2' : fbfx.config(0f, 0.95f, 240f); break; case '3' : fbfx.config(0.05f, 1.05f, 240f); break; case '4' : fbfx.config(0.05f, 0.95f, 240f); break; case '5' : fbfx.config(0f, 1f, 240f); break; case '6' : fbfx.config(0f, 1.05f, 240f); fbfx.wiggle(true, 0.2, 0.05, 0f); break; case '7' : fbfx.config(0f, 0.95, 240f); fbfx.wiggle(true, 0.2, 0.05, 0f); break; case '8' : fbfx.config(0f, 1f, 250f); fbfx.wobble(true, 0.5, 0.03, 1.05); break; case '9' : fbfx.config(0f, 1f, 250f); fbfx.wobble(true, 0.5, 0.03, 0.95); break; case '0' : fbfx.config(0f, 1f, 250f); fbfx.wiggle(true, 0.05, 0.05, 0f); fbfx.wobble(true, 0.3, 0.02, 1.05f); break; } }