Painting in Quartz Composer with Wiimote and iPhone

I'm very much into creating intuitive interactivity with minimum dependency on a controlled enviroment - so the experience can easily be recreated elsewhere with minimal hardware & setup (which is why I generally prefer optical flow analysis over blob tracking if I can, for vision related projects). So a conversation in the vidvox forums about painting in Quartz Composer using the Wiimote but without using the IR sensor really sparked my interest.

I've tried calculating an estimated position of the wiimote by integrating the accelerations before, and it's not bad, but by no means accurate enough to precisely control a cursor. I have plans to try and make that a bit more accurate - but with the motion plus just round the corner there might be no need (and it'll never be as good).

So I went for a much simpler option, using the orientation of the wiimote! Its actually quite straightforward and the composition is below. I've put in two modes, absolute & relative. In absolute mode, the roll of the wiimote is the x position of the paint cursor, and the pitch is the y position - and of course there is a smoothing interpolation on the values. In relative mode, the roll of the wiimote adds forces to the paint cursor in the x direction, and the pitch of the wiimote adds forces to the paint cursor in the y direction. And by pitch and roll, all I mean is the y-axis and x-axis raw acceleration values!

In my example I used OSCulator (go buy it now, you can't live without it) to send the raw wiimote acceleration values over OSC to port 9000, and listened to them in Quartz Composer smoothing and scaling as nessecary (my oscdocument is attached).

Of course why stop with the wiimote?... I fired up OSCemote (go buy that now too!) on my iPhone, turned the acceleration transmission on, scaled the values accordingly in QC and bobs your uncle! Painting in Quartz Composer with the iphone orientation! (I have OSCemote transmitting on port 3333, so you'll have to do the same). I found the wiimote feels a bit more responsive though, more sensitive, yet more controllable.

P.S. OSCemote is quite awesome, I'll have some interesting posts regarding that quite soon.

 

 

AttachmentSize
wiimote_iphone_paint.qtz21.79 KB
wiimote.oscd7.55 KB