I originally intended to use an open source flash library called google code wiiflash link
At first glance, it seemed awesome, which it is, however, I had far too many troubles getting it to read Infra Red Input. The
buttons, rumble, LED's and sound functions worked fine... just not the IR, which is unfortunately essential, so after seeing many examples of working wiimote apps i decided to go with what they were using...
THey were all using the wiimotelib library developed for C#
Not knowing much about C# was a small downer... but there was far more support and pre-made GUI's for it so it turned out to be a more stable option.
The problem was that i was making the application in flash, not C# and had to somehow get the info from C# over to flash in realtime so I could utilize it properly... along comes dekker who, and I quote.. "Wow, I can't believe how fun this is"... Im glad he had fun coding it...because it pretty much broke my brain...
Essentially the solution was a client/server in which C# would send over the IR info via a socket and the Flash app would read it...
this is the C# app i ended up using, it is from this site and, although it reads all input, I just have it sending the IR info over to Flash...
Picture of it in action(the colored dots are the IR from a wii sensor bar plus a calculated middle point)...

And this is a picture of the flash app in action with headtracking, at the moment it is just a bunch of planes i threw in using papervision3D...

It is still quite a bit buggy, but then again, that is just a quick and dirty "See if there are any communication errors" app.
Essentially there are two main bugs on my flash side, one being that it zooms in as you walk away...easily fixed by reversing the zoom math in the code.
The other bug being that i have not synced it to my stage properly, also easily fixed by some simple maths relative to the stage size...
All in all, this week has been ridiculously productive, I will have the headtracking working properly by Friday the 29th of August, so watch this spot :D
1 comment:
This looks great! I've been using WiiFlash and dealing with it, but I think that I'm making peace with the IR issues.
I look forward to following your progress.
Post a Comment