Man the title says it all – the WiiFlash server rocks and married with Papervision3D, well, that’s just about a slice of heaven right here in the RockOnFlash studios! Thibault Imbert and Joa Ebert really have done an outstanding job in creating a very solid server and a great looking, easy to use API for working with the wii’s in flash! I gotta say a special thank you to both of them, they really let me beat the crap out of them for 2 weeks leading up to FITC to get the drum demo working and it really was well worth the effort IMHO. Once you try the server and get connected, you’re gonna be hooked – it’s that easy!
First, I wanted to show the WiiBallet app and post the code for the demo. Thibault had asked me to work out a PV3D demo using the WiiFlash server and this is what I came up with. The idea was that a ballet dancer would hold the wii, and dance. Then they’d display the visual on screen as she danced. It was supposed to happen the FlashFestival in France a week ago, but I don’t know if it every quite panned out or not. Still waiting for the pics!
The amazing thing is, I spent 2 seconds on implementing the wii code and getting that connected and the rest of the time was spent on creating the PV3D app, then messing with it to find something that looked decent! The API for WiiFlash server is as easy as it gets:
[as]
private var wii:Wiimote = new Wiimote();
// later in the init() method
wii.connect();
[/as]
That’s IT! From there on out, all I had to do was grab the properties I wanted from the wii object I created, applied the angles to the new plane object I was creating on the fly, and BAM, render camera!
[as]
// I instanced these at the class level:
private var toDEGREES :Number = 180/Math.PI;
private var toRADIANS :Number = Math.PI/180;
// then we confvert to degrees since the wii props are in radians
plane.pitch(wii.pitch*toDEGREES);
plane.yaw(wii.roll*toDEGREES);
plane.roll(wii.roll*toDEGREES);
[/as]
(see Keith? I memorized em’ like you said
)
Source available here - I’ve commented through the code and it’s fairly straight forward. AS3 / Flex builder project files
In the video, you can see how I’m using roll and pitch with the wii to fly around in virtual space. The app creates planes on the fly, and the direction of the stream is dictated by the roll/pitch of the wii and some creative bending of the rules since we don’t have “yaw” with the wii without the sensor bar. To create the the chase cam, I actually created a dummy object (DisplayObject3D) and set it as the camera’s target. Then, I use transform.copy and copy the previous plane’s coordinates to the dummy. I’m later adding some camera movement around the stream based on the x/y properties I’m maintaining. This gave it a nice visual as though the cam were truly affect by the wii stream rather than just clumsily moving around the stream based on some noticeable constraints. I just wish I’d have more time to spend with it – this was about 4hrs total effort, and while it may show, I think it’s a testimony to how easy the WiiFlash API is to use and how well Papervision’s api works.
This last video with WiiFlash server is the drum demo I did at FITC in April. The drums are Papervision3D created in 3D studio max and animated with the Tweener animation classes. The WiiFlash server made this demo possible and very easy to create. This time, with 2 wiiMotes, the WiiFlash server just created another wii object and I was off and running. This was also the first time we’d demo’d Red5 doing midi out. For triggering sounds with any type of speed, we had to go outside the flash player and Red5 provided that via RTMP. The sounds are triggered from a Roland TD-10 sound module. Midi via RTMP – You gotta give it up for Red5


June 1, 2007 at 4:20 am
very cool, thanks for sharing.
June 1, 2007 at 5:16 am
niiiiiiice!! That must be the new place in Texas?
June 1, 2007 at 8:34 am
[...] RockOnFlash m/ :: John Grden » WiiFlash + Papervision3D = m/m/m/ June 1st, 2007 [...]
June 1, 2007 at 10:52 am
Ah now we can all do ballet in or chairs!
Great stuff!!
June 1, 2007 at 11:38 am
that was the small apartment we were in for 2 months – but yeah, it was in TX!
June 1, 2007 at 11:58 am
[...] John Grden posted some very nice WiiFlash examples on his blog. Go check them out! Thank you John for sharing this. [...]
June 1, 2007 at 12:25 pm
Hey John, Cool demo
are u using the standard XP bluetooth stack? or another one?
I can’t get my WiiMote to connect properly.
Rock On!
June 1, 2007 at 12:31 pm
Hey Patrick, as far as I know, the MS stack does not work and people have reported problems everywhere. It’s been reported that the Toshiba drivers work, and I can tell you personally that they do
I bought the Zoom USB Blue Tooth dongle and it ships with the Toshiba drivers and works extremely well.
June 1, 2007 at 3:29 pm
Off to the shop then
I’m throwing my dongle out the window!
………..weeeeeeeeeeee………….
June 2, 2007 at 1:35 am
Amazing stuff – as always
\m/
June 3, 2007 at 2:33 am
That’s awesome. Great work man.
June 3, 2007 at 10:14 am
[...] – Vous êtes flasheur ? vous avez une Wii ? développez dessus des applications ! avec Papervision3D par la même occasion, ce moteur 3D dont on a pas mal parlé ces derniers jours, et un WiiFlash server, en développement. Une petite communauté commence à sortir des choses intéressantes. Les vidéos valent le coup d’oeil même si on en est qu’au début de ces développements, on va pouvoir tous se croire créateurs de jeux vidéos [...]
June 3, 2007 at 5:43 pm
ridiculously awesome!
June 3, 2007 at 6:24 pm
holy SNIZZLES!!!
now I know how to scare the kids away from my computer! Wow……….
DUDE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
can you give me a haircut – seriously dude – that first “clip” – I think you can be the world’s first virtual barber!
Imaiging lining up sheep on a conveyor belt
June 4, 2007 at 3:36 pm
[...] If you’re tired of Japanese characters and want something easier to understand, John Grden of Red5 fame posted a few Papervision3D examples on his blog. These include WiiFlash, Red5, and other crazy mashups, and one of them – the one where John uses two wiimotes to hit virtual drums – use Tweener for some simple animation. Awesome stuff nonetheless. [...]
June 5, 2007 at 3:07 pm
Interesting.
Any day now I’m expecting to see someone use PaperVision+Apollo+WiiFlash to recreate the Mii Channel perfectly.
June 12, 2007 at 7:24 am
nice stuff mate , keep em coming .
June 18, 2007 at 3:51 am
[...] clipped from http://www.rockonflash.com [...]
September 10, 2007 at 8:55 pm
this = ownage!
wiiflash is so nice. the API is so organized and all the calls are logically named…
wiimote.conect();
September 11, 2007 at 7:42 pm
Is this Wii controller connected to a WIi at all or just a standard USB port?
September 11, 2007 at 8:22 pm
you use a BlueTooth connection. I use a USB Bluetooth dongle on my laptop and it works great!
October 11, 2007 at 7:02 pm
Are you using a sensorbar or something else to get x & y pos. of the wiimotes on your screen?
If not, do they need any calibration?
Thx.
October 11, 2007 at 7:29 pm
the drums require sensor bar, you can get a battery operated one for $20 at best buy.
The wiiBallet does not use the IR bar and only uses the roll/pitch properties of the wiiMote
there is no caliberation, but you can, of course, control the amounts with simple math
February 5, 2008 at 6:32 pm
Crazy work! I am trying to manipulate visuals and sound with the wiimote myself for a school project. I was wondering how crazy was the drum code? I wanted to disect it and create something myself but I don’t believe you made that code public
If there is any chance I can get a sample of the code please let me know!
Once again GREAT WORK!!
April 15, 2008 at 9:43 am
Hello,
I’m a French student and I would work and developp an application which use Flex and Wiimote in order to create a lot of 3D animations!
Do you use a Sensor Bar or not?Because a lot of applications in the web use it but I don’t understand the goal of this Sensor Bar.
Congratulations for your project
June 4, 2008 at 12:40 pm
[...] Read more [...]
July 22, 2008 at 4:34 pm
[...] If you’re tired of Japanese characters and want something easier to understand, John Grden of Red5 fame posted a few Papervision3D examples on his blog. These include WiiFlash, Red5, and other crazy mashups, and one of them – the one where John uses two wiimotes to hit virtual drums – use Tweener for some simple animation. Awesome stuff nonetheless. [...]