Wii API’s
December 24, 2007
I have been standing in line for a while now to get a chance to try out the Wii at Makro. Unfortunately so are quite a few children. I may just have to buy one untried now that I have seen the Wii Opera SDK. This includes:
Wii Remote detection – Remote Demo, VR Head Tracking Demo
Receive status Wii Remote buttons, pointer coordinates, sensor bar distance, and Z-axis roll.
3D rotations – Cube Demo, Rippling Water Demo
Rotate polygons in 3D space then translate them to z-sorted 2D to add that extra dimension to graphics.
Drawing effects – Ship Demo, Wall Demo, Floor DemoDraw lines, circles, rectangles, tiles, texture-mapped walls, and more.
Multiuser Communication
Allow multiple players/users to take part in the same of software.Download the SDK: Wii Remote, Graphics, 3D Math (General | FPS)
View the documentation.
also check out the wii remote api which the Opera folk have released. Allowing you to be able to monitor all of the remotes that are connected with The Wii Remote API.
-
-
//Obtaining the roll of the third Wii remote in degrees
-
-
var remote, roll = 0;
-
//check if the browser provides access to the Wii Remote data
-
if( window.opera && opera.wiiremote ) {
-
//get the KpadStatus object for the third Wii Remote
-
remote = opera.wiiremote.update(2);
-
//check that the remote is enabled
-
if( remote.isEnabled ) {
-
//get the roll angle in radians
-
roll = Math.atan2( remote.dpdRollY, remote.dpdRollX );
-
//convert the roll to degrees
-
roll = roll * ( 180 / Math.PI );
-
}
-
}
-
-
// Checking what buttons are pressed on the second remote
-
var remote, buttons = {};
-
//check if the browser provides access to the Wii Remote data
-
if( window.opera && opera.wiiremote ) {
-
//get the KpadStatus object for the third Wii Remote
-
remote = opera.wiiremote.update(1);
-
//check that the remote is enabled
-
if( remote.isEnabled ) {
-
//use the bitwise AND operator to compare against the bitmasks
-
buttons.pressedLeft = remote.hold & 1;
-
buttons.pressedRight = remote.hold & 2;
-
buttons.pressedDown = remote.hold & 4;
-
buttons.pressedUp = remote.hold & 8;
-
buttons.pressedPlus = remote.hold & 16;
-
buttons.pressed2 = remote.hold & 256;
-
buttons.pressed1 = remote.hold & 512;
-
buttons.pressedB = remote.hold & 1024;
-
buttons.pressedA = remote.hold & 2048;
-
buttons.pressedMinus = remote.hold & 4096;
-
buttons.pressedZ = remote.hold & 8192;
-
buttons.pressedC = remote.hold & 16384;
-
}
-
}
-
Tasty!!!