Wiimote TGE 1.5 Integration Day 2
by Vinh Tran · 03/12/2007 (7:42 am) · 17 comments
(using this blog to journal my work)
I've taken the source from cWiimote, applied a fix for the Toshiba Bluetooth Stack, and have added it to the platformWin32 directory and the TGE project.
The cWiimote class encapsulates all of the wiimote code and our only job is to call a HeartBeat() function to update the current state of the wiimote. At the moment I have put the call to this function within a process method that gets called in the normal game loop. Afterwards, we can pull out the state of any button on either the wiimote or the nunchuck. We can also pull out the state of the accelerators in either device. I have not tested the IR yet, but I will do that after I get everything else running.
All of the code is in place and I have the buttons working within TorqueScript once I set them up as binds to the GlobalActionMap.
Since i'm not an artist, i'm looking for a 3d model of the wiimote that I can add to the game world. Once the implementation is complete I want to release it as a resource with a sample app that puts the wiimote model in the game world and attempts to mimic whatever the user is doing with the real wiimote. If someone has a little free time I'd appreciate a model I can drop in. tranvv@gmail.com
Summary: The wiimote is functional within TGE. Now I just need to pretty it up and add in the rest of the functionality.
Todo:
support for all buttons and acceleration
support for IR
support for expansion port connection identification (unplugging/plugging in the chuck)
support for setting rumble and lights
support for multiple wiimotes
support for detection of connection of wiimote
I've taken the source from cWiimote, applied a fix for the Toshiba Bluetooth Stack, and have added it to the platformWin32 directory and the TGE project.
The cWiimote class encapsulates all of the wiimote code and our only job is to call a HeartBeat() function to update the current state of the wiimote. At the moment I have put the call to this function within a process method that gets called in the normal game loop. Afterwards, we can pull out the state of any button on either the wiimote or the nunchuck. We can also pull out the state of the accelerators in either device. I have not tested the IR yet, but I will do that after I get everything else running.
All of the code is in place and I have the buttons working within TorqueScript once I set them up as binds to the GlobalActionMap.
Since i'm not an artist, i'm looking for a 3d model of the wiimote that I can add to the game world. Once the implementation is complete I want to release it as a resource with a sample app that puts the wiimote model in the game world and attempts to mimic whatever the user is doing with the real wiimote. If someone has a little free time I'd appreciate a model I can drop in. tranvv@gmail.com
Summary: The wiimote is functional within TGE. Now I just need to pretty it up and add in the rest of the functionality.
Todo:
support for all buttons and acceleration
support for IR
support for expansion port connection identification (unplugging/plugging in the chuck)
support for setting rumble and lights
support for multiple wiimotes
support for detection of connection of wiimote
About the author
#2
As for IR i haven't considered it yet, may just whip out the candles!
03/12/2007 (11:35 am)
Yes I plan on working on getting support in for the wiimote speaker.As for IR i haven't considered it yet, may just whip out the candles!
#3
03/12/2007 (12:22 pm)
This is so cool...
#4
The Wii Remote's functionality would make PC games so much more fun ... and with the added abilities that PC games have over console games ... wow oh wow (simple to integrate network support, cross-communication between applications, faster storage performance [I/O Speed, More Disk Space]) ...
03/12/2007 (12:54 pm)
Sounds like an awesome project -- I can't wait till they make some Wii to PC USB adapters like they have for the Gamecube, PS and XBox controllers ... The Wii Remote's functionality would make PC games so much more fun ... and with the added abilities that PC games have over console games ... wow oh wow (simple to integrate network support, cross-communication between applications, faster storage performance [I/O Speed, More Disk Space]) ...
#5
As far as a model of the Wiimote, I think that's a great idea -- for my RagWii'd program, I have a little *very* cheesy model of a Wiimote that tilts in a way that mimics what the user is doing.

The model is just drawn in code with numbers for vertices and whatnot. The buttons change color to hilight when the user presses the buttons.
If I were better with the Torque exporters, I'd offer to make you a model, but I'm primarily a programmer and very secondarily I'm an artist. Maybe I'll still give it a shot though if nobody else jumps on this.
Thanks for the update! I'm pretty excited. :)
--clint
03/12/2007 (1:06 pm)
I've had candles work well for the IR sensor.As far as a model of the Wiimote, I think that's a great idea -- for my RagWii'd program, I have a little *very* cheesy model of a Wiimote that tilts in a way that mimics what the user is doing.

The model is just drawn in code with numbers for vertices and whatnot. The buttons change color to hilight when the user presses the buttons.
If I were better with the Torque exporters, I'd offer to make you a model, but I'm primarily a programmer and very secondarily I'm an artist. Maybe I'll still give it a shot though if nobody else jumps on this.
Thanks for the update! I'm pretty excited. :)
--clint
#6
03/12/2007 (1:25 pm)
I have a model of a Wiimote that I built in Silo 2. It's on another computer right now, but I'll try to post the file later today or early tonight.
#7
@Vinh and Clint - explain more about "candles" and IR input. :) I'm new to this. I found this on another page:
"Instead of using the usual Wii remote bar thingy on top of his screen, he uses two candles as IR emitters, allowing him to use the Wiimote without the bar."
Does the IR really work if you setup 2 candles? Like on this link:
www.techeblog.com/index.php/tech-gadget/wiimote-ir-candles-demonstration
03/12/2007 (1:38 pm)
@Vinh - I shot you an email...@Vinh and Clint - explain more about "candles" and IR input. :) I'm new to this. I found this on another page:
"Instead of using the usual Wii remote bar thingy on top of his screen, he uses two candles as IR emitters, allowing him to use the Wiimote without the bar."
Does the IR really work if you setup 2 candles? Like on this link:
www.techeblog.com/index.php/tech-gadget/wiimote-ir-candles-demonstration
#8
03/12/2007 (1:51 pm)
Yes -- infrared light is basically radiated heat, and candles are an extremely high output source of IR light. I've had great success lighting two candles and setting them about 4-6 inches apart, then synching up my Wiimote and getting it to track with the IR sensors rather than just the accelerometer data. It's really cool to see it in action, and the lit candles make you feel kindof like an alchemist. Just don't drip wax onto your keyboard. ;)
#9
So am I right then that the Wii itself doesn't receive anything from the IR bar - rather the IR bar you set on the TV transmits an IR signal that the WiiMote actually picks up? And since there are 2 transmission points the WiiMote can determine where it is pointing from that?
03/12/2007 (2:07 pm)
Very cool - So the other option would be to get the IR transmitters from radioshack - hook them up to AAA batteries and make a setup for on the monitor.So am I right then that the Wii itself doesn't receive anything from the IR bar - rather the IR bar you set on the TV transmits an IR signal that the WiiMote actually picks up? And since there are 2 transmission points the WiiMote can determine where it is pointing from that?
#10
03/12/2007 (2:35 pm)
That's correct -- no information is transmitted over the infrared link -- they are just reference points that the Wiimote picks up, and then transmits what it sees to the Wii over the Bluetooth link.
#11
www.aaronellis.net/wiimote.obj
(Right click to save file as)
Here is a wireframe pic of the object . . .

It's kind of heavy on the polygons at around 1200 triangulated, it's not textured, and it's no-where near perfect, but I'm not charging anything for it. :)
03/12/2007 (5:48 pm)
Here is a very simple Wiimote in .OBJ format . . .www.aaronellis.net/wiimote.obj
(Right click to save file as)
Here is a wireframe pic of the object . . .

It's kind of heavy on the polygons at around 1200 triangulated, it's not textured, and it's no-where near perfect, but I'm not charging anything for it. :)
#12
03/13/2007 (8:25 am)
Um... Let me get this straight. What would happen if I had a candle or two going in the room when I'm playing with the Wii. Would it mess with or at least hinder the performance of the Wii?
#13
@Peter: I'm not for sure on this, but I *think* that it's looking for two IR light sources that are high output and relatively close together (4-6 inches or something, I'm not sure what the limit is for the Wii). If you just have one candle, I haven't been able to get the Wiimote to recognize it, it really needs to be 2 points. So if you had scattered candles it probably wouldn't screw with the WiiMote, but if you had a menorah with 2 of the candles lit, that might screw with it, yes. :)
03/13/2007 (8:35 am)
@Aaron: Looks good! (especially in comparison with mine. :) )@Peter: I'm not for sure on this, but I *think* that it's looking for two IR light sources that are high output and relatively close together (4-6 inches or something, I'm not sure what the limit is for the Wii). If you just have one candle, I haven't been able to get the Wiimote to recognize it, it really needs to be 2 points. So if you had scattered candles it probably wouldn't screw with the WiiMote, but if you had a menorah with 2 of the candles lit, that might screw with it, yes. :)
#15
03/13/2007 (12:35 pm)
IR transmitters are like $1.75 each from Radioshack - just hook each up to a battery and you have a safer source than candles lol. (I work on a laptop so I'm not about to put candles below my screen lol!)
#16
I'd love to seet the code as a download prior to a resource becoming available. (If possible).
03/15/2007 (10:22 am)
Excellent work. Keep us posted.I'd love to seet the code as a download prior to a resource becoming available. (If possible).
#17
@D Higgins:
You can go grab a bluetooth adapter now and download GlovePIE to convert your wiimote into any keyboard/jstick/mouse commands. This is a great solution to create a highly customizable wiimote-pc conversion.
03/16/2007 (8:22 am)
Thanks for the model this should work great.@D Higgins:
You can go grab a bluetooth adapter now and download GlovePIE to convert your wiimote into any keyboard/jstick/mouse commands. This is a great solution to create a highly customizable wiimote-pc conversion.

Torque Owner Eric Schuld
Also curious what you are using for your IR detection - I noticed the other person on these forums made one using like $7 in radio shack parts. Will you be doing the same thing? If so - will you provide instructions for those of us who are not so Radio Shack inclined. :)
Lookin' good though!
-eric schuld