cocoa

Quartz Composer and the Nintendo Wii Remote - QCWii a demo application » read article

posted by ian grant on February 12, 2007 at 3:14 pm | in cocoa, mac development, physical computing, quartz composer, software | 3 comments

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

qc stereoscopic recorder 0.1 » read article

posted by ian grant on February 5, 2006 at 9:31 pm | in cocoa, creative code, quartz composer, software | 1 comment

qcstereoscopic recorder icon

Download Application: QCStereoscopicRecorder 0.1 (Universal Binary) OS 10.4 required

Download Source: QCStereoscopicRecorder 0.1 Source (4.0mb)

QC Stereoscopic Recorder is my first Cocoa app! It is part of my work towards an MA in Computer Arts. The app is a component of a larger project called “Anamorphica” in a class called “Experimental Digital Media”. Further documentation of this project will appear over the next few weeks. Basically, I am aiming to make a low-cost open source anaglyph recording and ‘performance’ system.

To use it you will need two firewire cameras.

Performance is improved if each camera comes in on a separate firewire bus. To effect this, I use a Lacie firewire PCMCIA card in my G4 laptop.

I needed a simple application that would capture dual camera input, export to quicktime and make an anaglyph.

I have included “stereo-pair” generation. Stereo-pair generation will come into it’s own when the application can handle full-screen and dual monitor support. Then I may create a ‘Wheatstone’ device (see http://www.stereoscopy.com/library/wheatstone-paper1838.html).

QCStereoscopic Recorder would not have happened if it wasn’t for the wonderful “Quartz Composer”. Easy and a joy to use. As I am learning Cocoa and Objective-C, the project is indebted to sample code and open source initiatives.

  • demo code from Apple - QCTV / Pierre-Olivier Latour
  • the wonderful “Sparkle” by Andy Matuschak (www.andymatuschak.org) handles software updates from within the applications.

To Do

  • full screen mode
  • improve image contrast quality
  • fully implement Apple help
  • export print resolution single frames
  • implement VJing style performance control

Notes

  • Built as a universal binary - untested on Intel
  • tested on PPC - 10.4.4

Have fun!

early recursive anaglyph experiment made with qc stereoscopic recorder
early recursive anaglyph experiment made with qc stereoscopic recorder

(cc) ian grant some rights reserved