Page 1 of 1

WiiMote implementation

Posted: Fri Oct 12, 2012 1:34 pm
by BenJuan26
Hi everyone,
It's been some time since I've been on these forums but I was just looking through my YouTube videos and was reminded that someone had commented saying they wanted to share the video of my WiiMote implementation into D3. I'm not sure if he ever did so I thought I'd share it in case anyone is into that sort of thing. The video can be found here.

On another note, I lost the code I had to make this work, but it could easily be recreated or I could give instructions if anyone is interested in doing this themselves. It was done using GlovePIE and PPJoy, with the WiiMote connected through Bluetooth. To be perfectly honest it's not the most ideal/practical control method but it does offer a nice alternative in case a joystick is not available and you already have a WiiMote lying around.


Re: WiiMote implementation

Posted: Mon Oct 15, 2012 6:53 am
by snoopy

Looks cool. You should track down the code again!

Re: WiiMote implementation

Posted: Mon Oct 29, 2012 10:25 am
by BenJuan26
I'm going to be around the computer that probably still has the code this weekend, I'll see if I can dig it up.

Re: WiiMote implementation

Posted: Tue Oct 30, 2012 4:39 am
by Jeff250

Re: WiiMote implementation

Posted: Fri Nov 02, 2012 3:35 pm
by BenJuan26
Hi all,
I managed to dig up the code. In order for everything to work properly you will need PPJoy and GlovePIE installed (I won't go over how to do that here). The following code is then run within GlovePIE:

Code: Select all

if wiimote1.pointerx > 0.25 and < 0.75
   ppjoy1.analog0 = MapRange(wiimote1.pointerX,0.25,0.75,-0.25,0.25)
   else ppjoy1.analog0 = MapRange(wiimote1.pointerX,0,1,-1,1)

if wiimote1.pointery > 0.25 and < 0.75
   ppjoy1.analog1 = MapRange(wiimote1.pointery,0.25,0.75,-0.25,0.25)
   else ppjoy1.analog1 = MapRange(wiimote1.pointery,0,1,-1,1)

PPJoy1.Analog2 = Maprange(Wiimote1.Nunchuk.JoyX,-1,1,-1,1)

if wiimote1.roll > -30 and < 30
   ppjoy1.Analog3 = 0
   else ppjoy1.Analog3 = MapRange(Wiimote1.roll, -120 degrees,120 degrees, -1,1)

PPJoy1.Analog4 = MapRange(Wiimote1.Nunchuk.JoyY,-1,1,-1,1)
PPJoy1.Analog5 = MapRange(WiiMote1.Nunchuk.Pitch,-90,90,-1,1)
PPJoy1.Digital0 = Wiimote1.A
PPJoy1.Digital1 = Wiimote1.B
PPJoy1.Digital2 = Wiimote1.Nunchuk.CButton
PPJoy1.Digital3 = Wiimote1.Nunchuk.ZButton
PPJoy1.Digital4 = Wiimote1.Plus
PPJoy1.Digital5 = Wiimote1.Minus
PPJoy1.Digital6 = Wiimote1.Home
PPJoy1.Digital7 = Wiimote1.One
PPJoy1.Digital8 = Wiimote1.Two
PPJoy1.Digital9 = Wiimote1.Up
PPJoy1.Digital10 = Wiimote1.Down
PPJoy1.Digital11 = Wiimote1.Left
Hopefully some of you can try it out and see what you think.