Quartz Composer and the Nintendo Wii Remote – QCWii a demo application
posted by ian grant on February 12, 2007 at 3:14 pm | in cocoa, mac development, physical computing, quartz composer, software | 3 commentsDownload Application: qcwii_v0.1.zip
Download Source Code: qcwii_v0.1_src.zip
QCWii is an application that lets a user connect a Nintendo Wii Remote to the mac and control a simple teapot.
It is a proof of concept for a digital puppet controller. The final project controls a face – where the mouth is real-time video and the eyes a pre-recorded video loops that can be controlled from the wii remotes buttons. Please see the following website for more details and the project write up.
Link: http://ellington.tvu.ac.uk/ma/computer-arts-major-project/


The source code demonstrates the following:
- how the darwiin-remote framework can be used to control a 3D model in a simple Quartz Composer patch.
- how cocoa bindings work connecting UI elements, code and published keys from a quartz composer patch.
- a crude ‘full screen’ mechanism.
Many thanks to Jasen Jacobsen for advice on how to make the animation smooth and to Hiroaki for the ‘Darwiin-Remote’ framework and project.
Link: http://sourceforge.net/projects/darwiin-remote/
Usage
To connect to the Wii Remote: press button 1 and 2 on the wii remote so the lights flash, then click ‘Connect with wii remote’ on the preference pane:

To activate sensor tracking: click ‘Track Motion Sensors’ on the same preference pane.
That should be it. Most of the buttons on the Wii are connected to do something in the Quartz Composer composition – if only signal a connection to the patch.
- The cursor pad moves the object, left, right (x axis), forward and backwards (z axis).
- Buttons 1 and 2 rotates the object around the Y axis.
- + and – scale the object.
It is acknowledge that both scaling and translating on the Z axis is probably not as useful as moving up and down.
To exit full screen mode – press SHIFT – F on the keyboard.
Some Additional Information if you wish to edit the Quartz Composer Patch to do something other than move a teapot around
To find the QC composition:
ctrl-click on the QC-Wii application ‘view package contents’ and dig down to ‘resources’ that is where the QC patch – wii_to_qc.qtz – lives. You can (carefully) edit that composition to do something different other than trigger the text display and move the teapot… Just don’t change the name of any of the root level published port ‘keys’:

Image: The crucial published keys that bind the patch to the wii remote via the application. Do not change the published name of these – or the application will break
If you edit that composition, save it. Then when you re-launch the application, it will use the edited composition as it’s source.
This way you don’t need to use xcode or re-build the application.
The qc patch needs to run inside an application wrapper. The application handles all the blue-tooth connection wizardry provided by the wiiremote-framework, the calibration preferences etc and toggling full screen. So you can’t simply edit the composition and preview it using Quartz Composer itself and expect the WiiRemote to connect.
Ian Grant January, 2007
ian [dop ] grant [at ] mac [dop ] com
3 comments
sorry, the comment form is now closed.
(cc) ian grant some rights reserved
I still have’nt tried this but it looks pretty interesting, but im hoping somebody will come up with a program that will create visuals similar to those win amp visiualizers, i.e (Ge-Force), but instead of the visuals responding to the music it would respond to the movement of the wiimote..thats just something to think about.
comment by Gabriel — February 21, 2007 #
Thanks Gabriel, I’ll check out the win amp visualizers…
regards,
Ian
comment by ian grant — March 28, 2007 #
this works great. you rock for putting the source out there.
comment by Sam Soffes — August 14, 2007 #