Needs of the Programming Project
From Physical Programming
The Programming project: Wii remote, Quartz Composer and Google Earth.
Knowledge
Darwiin remote:
DarwiinRemote is an application for Mac OS X v10.4 or above which allows Wii Remote to fully control applications on a Mac. The software includes a desktop application and a developers' framework, allowing for additional functionality. To use the software, the computer must have Bluetooth enabled. By editing the source code or customizing the application's preferences, the buttons on the remote can emulate any key combination on the Mac. By default, the Remote's buttons correspond with the following keys: Wii Remote Key Mapping A Left-Click B Return (Enter) Up Up Key Down Down Key Left Left Key Right Right Key Plus Command + Right Minus Command + Left Home Command + Esc One (1) Mouse Mode ON/OFF (Motion Sensor Mode) Two (2) Mouse Mode ON/OFF (IR Sensor)
Launch DarwiinRemote
Press 1 button and 2 button of your Wii Remote simultaneously
- Wii Remote becomes "discoverable mode" (4 blue LEDs are blinking)
-Log drawer in DarwiinRemote reports "Wii Remote is found!"
The Darwiin remote Quartz composer patch
The patch is downloaded (Download the Darwiin patch at blog.hiroaki.jp/2006/12/000433.html) and opened within Quartz composer, ctrl-click on the QC-Wii application ‘view package contents’ and go to ‘resources’ that is where the QC patch - wii_to_qc.qtz - lives.
The 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 its source.
Info about AppleScript and Apple Events
AppleScript was designed to be used as an end-user scripting language, offering users an intelligent mechanism to control applications, and access and modify information and documents. For example, an AppleScript might open a photo in a photo-editing application; reduce its resolution; add a border; add a photo credit; export a Web-ready copy; write a Web link for the photo into a text editor then move on to the next photo in the set and so on through hundreds or thousands of photos, creating a Web-ready photo gallery.
Whereas Apple Events are a way to send messages into applications, AppleScript is a particular language designed to send Apple Events. In keeping with the Mac OS tradition of ease-of-use, the AppleScript language is designed on the natural language metaphor, just as the graphical user interface is designed on the desktop metaphor. AppleScript programs are generally readable by anyone, and editable by most. The language is based largely on HyperCard's HyperTalk language, extended to refer not only to the HyperCard world of cards and stacks, but also theoretically to any document.
An Apple event proper is an AERecord with fields that depended on the purpose of the event. In addition, it has attributes (which are distinct from record fields, which are now called the parameters of the event) from a set predefined by the Apple Event Manager, specifying such things as the event type and class codes which indicates what the event is supposed to do, the target address to which the event is to be sent (which could be a process on the local or a remote machine), and various other options for handling it.
In short, how the project will be achieved: The Darwiin remote application is downloaded and opened once installed. The Wii remote is then synced to the Darwiin application. The Darwiin remote quartz composer patch is downloaded and opened in Quartz composer. The patch in Quartz composer will analyse the data from the remote. The data is entered in Applescript and it then sends an AppleEvent. Google Earth application is opened. AppleEvents then communicates with Google Earth to control movement through the Wii remote.
Skills
Knowledge of AppleScript language
Knowledge of Quartz composer composition editing
Materials, software needed
Wii Remote
Mac computer
Darwiin remote quartz composer patch


