by date
Wii Remote + IR Sensor Bar
Wii Remote + IR Sensor Bar
| Name: | Rob Terrell | |
|---|---|---|
| Date Posted: | Dec 18, 2006 | |
| Rating: | 5.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Rob Terrell |
Blog post
The Wiimote is really working well in TGE now. Here's a shot of it controlling the default demo mission, with the "killer kork" resource added in to make it interesting. I mapped the Wiimote "A" button to move forward, and the "B" trigger button to fire.

Here's the screen capture video. YouTube link for the bandwidth conscious, and QuickTime for those who don't care what my ISP thinks about me.
To make this work, I put together a homemade sensor bar with under $10 of parts from Radio Shack and crap lying around the room:

If you want to make your own, I run through the how-to (basically, LEDs, wires, batteries) on my personal blog.
The "sensor bar" isn't actually a sensor -- it provides an absolute point of reference. Without the sensor bar, the Wii remote can only detect the controller's tilt along three axes. (If you looked closely at my earlier video, you'll see that, to control the game, I was tilting the controller each time I wanted to go left or right.) This works and is fun, but it makes aiming very hard.
So, with a sensor bar above the screen, we can actually get absolute X and Y values. The controller gives us a floating point value between 1.0 and -1.0 that we translate into an on-screen coordinate. Point to a spot on the screen, and the mouse pointer jumps to it.
Also, a change from before. I mapped the "A" button to mouse button 3, and the "B" trigger button to mouse button 4. This way the Wii buttons can be more independently mapped from your mouse controls.
So next, I think, is to automatically switch to accelerometer mode when the IR link is down (i.e. the controller has moved too close to the LEDs, or too far to one side, and can't see both). Also, there's a way to run in a single-LED mode, which would probably be good enough for this use. That would let me get closer to the screen (in the video you see me back off).
I've also added rumble support, but I need to expose that to scripting. Maybe later tonight.
I will try to clean this up and make a resource. If anyone is interested in a binary release, let me know in the comments.

Here's the screen capture video. YouTube link for the bandwidth conscious, and QuickTime for those who don't care what my ISP thinks about me.
To make this work, I put together a homemade sensor bar with under $10 of parts from Radio Shack and crap lying around the room:

If you want to make your own, I run through the how-to (basically, LEDs, wires, batteries) on my personal blog.
The "sensor bar" isn't actually a sensor -- it provides an absolute point of reference. Without the sensor bar, the Wii remote can only detect the controller's tilt along three axes. (If you looked closely at my earlier video, you'll see that, to control the game, I was tilting the controller each time I wanted to go left or right.) This works and is fun, but it makes aiming very hard.
So, with a sensor bar above the screen, we can actually get absolute X and Y values. The controller gives us a floating point value between 1.0 and -1.0 that we translate into an on-screen coordinate. Point to a spot on the screen, and the mouse pointer jumps to it.
Also, a change from before. I mapped the "A" button to mouse button 3, and the "B" trigger button to mouse button 4. This way the Wii buttons can be more independently mapped from your mouse controls.
So next, I think, is to automatically switch to accelerometer mode when the IR link is down (i.e. the controller has moved too close to the LEDs, or too far to one side, and can't see both). Also, there's a way to run in a single-LED mode, which would probably be good enough for this use. That would let me get closer to the screen (in the video you see me back off).
I've also added rumble support, but I need to expose that to scripting. Maybe later tonight.
I will try to clean this up and make a resource. If anyone is interested in a binary release, let me know in the comments.
Recent Blog Posts
| List: | 08/09/08 - iPhone games! 04/08/07 - TGWii Code 12/21/06 - Wii Remote Beta Binary 12/18/06 - Wii Remote + IR Sensor Bar 12/15/06 - Wii Remote Control in TGE is Working |
|---|
Submit your own resources!| Aun Taraseina (Dec 18, 2006 at 03:04 GMT) Resource Rating: 5 |
Can't wait to see this as a resource.
| Donald \"Yadot\" Harris (Dec 18, 2006 at 03:51 GMT) |
Very cool work!
| Aaron E (Dec 18, 2006 at 04:07 GMT) |
I must say, a binary would be super cool. Here's the quicktime link again.
stinkbot.com/Wiimote+IR.mov
Edited on Dec 18, 2006 04:12 GMT
| Todd Pickens (Dec 18, 2006 at 06:23 GMT) |
| Ben Garney (Dec 18, 2006 at 09:37 GMT) |
| Richard_H (Dec 18, 2006 at 11:22 GMT) |
| Dave Young (Dec 18, 2006 at 18:24 GMT) |
| Rob Terrell (Dec 18, 2006 at 21:51 GMT) |
Also, this kind of controller gives lots of options. With the IR turned on, X-Y position can be handled by the pointer, leaving you the tilt axes for other things. If you've played Wii golf, think about how that works. The IR mode is used for positioning the cursor on screen, whereas the accelerometers control the swing of the club. You can both interact with the GUI or swing the club. Think of a sword-fight game (the inevitable jedi game) -- you could position the base of the sword using the IR mode's X-Y coords, and then allow the user to twist the controller to parry. (I guess the best demo I could make would be a light-saber positioning demo.)
Anyway, I doubt that PC gamers will buy Wiimotes. I just wanted to prototype a game idea for the Wii.
| Dave Young (Dec 18, 2006 at 21:54 GMT) |
| Vashner (Dec 18, 2006 at 21:59 GMT) Resource Rating: 5 |
:)
| Pisal Setthawong (Dec 19, 2006 at 04:20 GMT) Resource Rating: 5 |
| Kunalvardhan (Feb 25, 2007 at 16:42 GMT) |
You must be a member and be logged in to either append comments or rate this resource.


5.0 out of 5


