Friday 30 March 2007

Wiimote PC 3d Games controller motion logger

This is an update for where I am with writing PC Games that utilise the Wiimote and Nunchuk.

I firstly got a blank 3D world going in TrueVision3D which I have mentioned on the previous post. Once I had this world with a wiimote and my banana I realised that it is actually a difficult task to study the acceleration outputs of the wiimote and nunchuk and to translate them into motions in a 3D world.
I decided to implement the C# WiimoteLib version 1.0.1.0 from Brian Peek (thanks Brian). There is a test program that comes with his driver that displays all of the outputs of the Wiimote and Nunchuk in a nice little windows application. I have taken that test program and edited it a bit to give me some reuslts that I want to find useful and use for motion translations with my 3D games. The outputs displayed that I am interested in are straight forward float numbers showing the X,Y, and Z axis accelerations of the Wiimote and Nunchuk (-0.5 to +0.5 in strength). I figured that there would be some kind of a pattern to these outputs that would be the same for certain motions. To demonstrate what I have changed in Brians test code consider the following: Lets say you want to play a game like fishing and essentially you want to cast out the rod. Firstly you will raise the wiimote so it will rotate slowly upwards while being raised about 1 foot. Then as it is stationary the only acceleration will be gravity (9.81 metres per second squared in the vertical direction). Then as you whip it acceleration will change to downwards in the vertical and the wiimote will rotate again back to its starting position. This whole motion will show 3 patterns of accelerations, so you can then say when the player is doing a cast because the wiimote outputs will be in a similar pattern to this varying in strength.

I have written a program to try and help me to log all of these motion patterns that I need, and full details of it can be seen here on the Wiimote PC Games section of my fun stuff website.

The next phase should be incorporating these movements to my character in my 3D world and then I can give this character some tasks. Most probably breaking things and smashing stuff up to start with as the punching motion is a fairly straight forward one to get right and measure player strength.


Cheers,

L.

No comments: