Using wiimote IR camera data

Using wiimote IR camera data

Archived SketchUp forum thread, with an innovative method of work.

miket

12/11/08

Situation: I would like to write a plugin to do head tracking in sketchup with the use of the miimote similar to the demonstration by Johny Lee http://www.cs.cmu.edu/~johnny/projects/wii/

Question 1: Is it possible for ruby to get data from the wiimote without tricking it into thinking the input is from the mouse? What I would like to do is to have the head tracking control the view while not interrupting the use of the mouse to design and draw in the viewport

Question 2: To be accurate head-tracking, I need to be able to relocate the center of vision away from the center of the screen. (i.e. imagine a one-point perspective that vanishes to a point not in the middle of the screen, like the corners.) This isn't a deal breaker if it isn't possible but it would definitely improve the effect.

Thanks.

-Mike

Patrick

12/12/08

I've played around with using GlovePIE (which adapts a lot of interesting controllers including wiimotes; http://glovepie.org/glovepie.php) and SketchUp together. I set it up to work more as a mouse with tool controls on the nunchuk, making it kind of like playing Trauma Center.

Pretending the input is from the mouse is by far the easiest technique.

Other ways to send data to your ruby script: * Have your ruby script watch output.txt in the GlovePIE directory, then in the glovepie script, use the outputotfile command to output data. This isn't quite as elegant as option 2: * Use GlovePIE's OSC functionality to send messages to your ruby script. OSC is a simple network interface, so you can SendOsc ("localhost", my_port, "/anything/here", target.x, target.y, roll). You'd set your Ruby script up to listen to the OSC commands.. you can do this with rosc (http://hans.fugal.net/src/rosc/) or a home-brew ruby server.

GlovePIE also has functionality to scroll the desktop, which is intended for head-mounted displays. It might be an interesting trick to handle Question 2. I think it will be hard to change the center of vision with the way SketchUp manages its camera (target, eye, up instead of an arbitrary projection matrix).

There may be other ways to get the wiimote data without using GlovePIE (which is windows-only).

Patrick

Jim

12/14/08

Hi Mike,

Here's a couple links that might be helpful - I don't really know. They are showing a wiimote controling objects (via Ruby) in SketchUp in the SketchyPhysics plugin.

http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=11205

http://www.sketchucation.com/forums/scf/viewtopic.php?f=15&t=11204

miket

12/29/08

thank you very much. I think all of those options are worth exploring. The desktop scrolling would be an interesting work-around to move the centered target, although it would require a desktop running at 9 times (3x3) the resolution that the monitor is showing. I will play around with this. If I get anything interesting, I'll post it.

-Mike