1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

WiiNode

Description

WiiNode is a library for connecting your WiiMote to NodeBox. No actual Wii is needed, just the remote.

Download

downloadwiinode.zip (24KB)
Last updated for NodeBox 1.9.4
Licensed under the GPL
Author: Frederik De Bleser

Documentation



Prerequisites

OSCulator makes the connection with the WiiMote possible. The necessary configuration settings are in the wiidraw.zip file under settings.oscd.

The program needs to be running in the background, and communicates over OSC.

Getting your WiiMote to work with the program, for me, meant pushing the buttons "1" and "2", or alternatively, the red SYNC button (under the battery cover), a few times. Once you get a battery reading, you should be fine.


How to get the library up and running

Put the web library folder in the same folder as your script so NodeBox can find the library. You can also put it in ~/Library/Application Support/NodeBox/.

wiinode = ximport("wiinode")

Outside of NodeBox you can also just do import wiinode.


Setting up the main loop

In your animation, initialize the WiiMote object. Then, in each frame, call the update method:

def setup():
global wm
wm = wiinode.WiiMote()

def draw():
global wm
wm.update()
print wm.yaw

The WiiMote class

To get a good overview of all the values, check out wiinode_example3.py, which visualizes all available WiiMote attributes.

Rotation

The WiiMote returns roll, pitch and yaw. See the Wikipedia article on flight dynamics for more information.

See the wiinode_example1.py for a game that uses the roll value.

wm.pitch # The absolute pitch value
wm.roll # The absolute roll value
wm.yaw # The absolute yaw value

Acceleration

The WiiMote returns acceleration in both x, y and z positions. This is not the remote's absolute position in space. You need an infrared sender for that.

wm.x # The horizontal (left-right) acceleration
wm.y # The forward acceleration
wm.z # The vertical (up-down) acceleration

Buttons

The WiiMote's A and B buttons can be monitored as well.

wm.a # True if the A button is pressed
wm.b # True if the B button is pressed

Show me someone fooling around with this