Motion Controlled Pong demo

Here’s a Pong demo of some of the optical flow motion triggering stuff we’ve been working with at Tangible Interaction lately.

Basically you move the paddle using left and right motion in front of the camera. If you hit the ball, your paddle gains the ball’s current colour. Watch out though, there is no AI player yet!

I have plans for the future to add in some visual effects, as well as a second player that can be controlled either by AI, or with a second webcam.

[attachment=2:2uh571an]screenshot1.jpg[/attachment:2uh571an]

Here are the controls for this demo:

z/x - move paddle left/right
p - toggle optical flow for paddle
b - toggle optical flow for ball
left/right arrows - adjust magnitude increment (value that is added/subtracted when adjusting magnitude settings)
up/down arrows - adjust magnitude multiplier
-/+ - adjust minimum magnitude
shift+ -/+ - adjust maximum magnitude
c - toggle console display (debug text at top of screen)
v - toggle video display
o - toggle optical flow display
a - toggle optical flow average display
t - toggle optical flow triggers display

Enjoy!

motionPongTI_demo_v1.2_src_xcode.zip

motionPongTI_demo_v1.2_addon_pack.zip

thanks for sharing! looks nice

compile notes: beside ofxColours, ofxMotionTracker, and ofxTI_Utils. ‘void ofCircleSlice’ is needed ( viewtopic.php?p=10691 )

[quote author=“lian”]
compile notes: beside ofxColours, ofxMotionTracker, and ofxTI_Utils. ‘void ofCircleSlice’ is needed ( viewtopic.php?p=10691 )[/quote]

true. thanks for linking that lian. the other option is to comment out the line #define DRAW_TRIGGER_ARC in MotionTrigger.h

Hi plong0!

Thanx for sharing! Can you make Motion Controlled Pong demo for Windows XP, include exe file
and put a short explanation for the novice.

Thanx!
Mladen

YEEahH !
Amaaazing example.

About this code…why all is manage as “this->” … I feel little :oops: but Im curious

cheers!

[quote author=“charli_e”]YEEahH !
Amaaazing example.

About this code…why all is manage as “this->” … I feel little :slight_smile:

all the this-> accessors is just my code style… keeps everything perfectly clear on what scope I’m using… especially in cases where I might have a method variable and class variable with the same name.

Just wanted to post the latest version of the ofxMotionTracker add-on…

I’ve also included the ofxMotionTracker1394 version to work with the ofxVideoGrabber add-on (in case you need the more advanced functionality for firewire cameras).

Hopefully at some point in the future the two will be combined… Shouldn’t be too hard to update frameDifferencer with a pre-compiler flag to select which one…

Please note I haven’t tested the new add-on versions with the original example… but hopefully things aren’t changed too much between the versions :slight_smile:

ofxMotionTracker_beta2.zip

ofxMotionTracker1394_beta2.zip

Hi plong0, a really useful set of classes, thanks for posting. It would be great to see your ofxBox2DMotion class you mention in some of your other posts on opticalFlow.

Cheers

Brendan