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 detectionRemote Demo, VR Head Tracking Demo

Receive status Wii Remote buttons, pointer coordinates, sensor bar distance, and Z-axis roll.
3D rotationsCube Demo, Rippling Water Demo
Rotate polygons in 3D space then translate them to z-sorted 2D to add that extra dimension to graphics.
Drawing effectsShip Demo, Wall Demo, Floor Demo

Draw 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.

  1.  
  2. //Obtaining the roll of the third Wii remote in degrees
  3.  
  4. var remote, roll = 0;
  5. //check if the browser provides access to the Wii Remote data
  6. if( window.opera && opera.wiiremote ) {
  7.   //get the KpadStatus object for the third Wii Remote
  8.   remote = opera.wiiremote.update(2);
  9.   //check that the remote is enabled
  10.   if( remote.isEnabled ) {
  11.     //get the roll angle in radians
  12.     roll = Math.atan2( remote.dpdRollY, remote.dpdRollX );
  13.     //convert the roll to degrees
  14.     roll = roll * ( 180 / Math.PI );
  15.   }
  16. }
  17.  
  18. // Checking what buttons are pressed on the second remote
  19. var remote, buttons = {};
  20. //check if the browser provides access to the Wii Remote data
  21. if( window.opera && opera.wiiremote ) {
  22.   //get the KpadStatus object for the third Wii Remote
  23.   remote = opera.wiiremote.update(1);
  24.   //check that the remote is enabled
  25.   if( remote.isEnabled ) {
  26.     //use the bitwise AND operator to compare against the bitmasks
  27.     buttons.pressedLeft = remote.hold & 1;
  28.     buttons.pressedRight = remote.hold & 2;
  29.     buttons.pressedDown = remote.hold & 4;
  30.     buttons.pressedUp = remote.hold & 8;
  31.     buttons.pressedPlus = remote.hold & 16;
  32.     buttons.pressed2 = remote.hold & 256;
  33.     buttons.pressed1 = remote.hold & 512;
  34.     buttons.pressedB = remote.hold & 1024;
  35.     buttons.pressedA = remote.hold & 2048;
  36.     buttons.pressedMinus = remote.hold & 4096;
  37.     buttons.pressedZ = remote.hold & 8192;
  38.     buttons.pressedC = remote.hold & 16384;
  39.   }
  40. }
  41.  

Tasty!!!

Advertisements

YSlow 0.9

December 7, 2007

I’ve mentioned YSlow – the firebug add-on that allows you to monitor what is slowing down your site. using YSlow I have found the most horrendous code in ‘free’ wordpress plugins that download all sorts of things your mother wouldn’t like, SEO tools that stuff cookies, unscrupulous developers using your site to boost their own stats. Its a tool that is essential if you’re doing any kind of forensic investigation into a site’s usability, speed and accessibility, for SEO or any other purpose. The good news is that they’ve just released version 0.9.

There are two big features in this release. By integrating more tightly with Firebug’s Net Panel, YSlow now finds non-DOM components such as Ajax requests and image beacons. And YSlow now crawls frames and iframes and analyzes those resources as well. There are several other new features and bug fixes described in the release notes including highlighting 404s, better detection of CSS expressions and JavaScript minification, and searching within the YSlow panel.

These features make YSlow stronger at identifying performance improvements for Web 2.0 applications. It’s great that YSlow does even better performance analysis of pages, but be forewarned that your previous YSlow scores will drop if these new-found components exhibit bad performance characteristics. As mentioned in Rule 14 – Make Ajax Cacheable, some of the performance improvements that are readily applied to static content (far future Expires header, gzip compression, minification) can also be applied to Ajax responses. Whether it’s Web 1.0 or Web 2.0, YSlow 0.9 helps you figure out what to fix to make your pages faster for your users.