Image Image Image 01 Image Image Image Image Image Image Image Image Image Image

Digital Performance Practice and Research.

Scroll to Top

To Top

mac development

Quartz Composer and the Nintendo Wii Remote – QCWii a demo application

Download 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/
Qcwiimainscreen


Qcwiimainscreen Pref 01 Pref 02 Pref 03

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:

Pref 01

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’:

crucial published keys that bind the patch to the wii remote via the application
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