When Wii Met SketchUp


Every movement, orbit, walk, zoom etc. in the movie above is controlled with the wiimote instead of the mouse. This way, one is not bound to the computer while navigating in SketchUp – perfect for presentations.

I have been amazed for a while by Johnny Chung Lee‘s experiments with the Wiimote and particularly the idea of using it to create a multitouch whiteboard. That, however, will be tried out another day. Today I am presenting a method to use the Wiimote as a tool for navigating 3D space in SketchUp.

Where did the idea come from? A few days ago, I received a blog post from Autodesk Labs stating that they implemented Wiimote navigation for their Design Review product (ADR a great, free 2D/3D viewer and drawing markup tool). While I was waiting to get some installation issues with that one resolved, I decided to try this out with SketchUp. And it worked!

So what can we do with this? Well… I like the idea of using it for presentations. At this point, you can use the roll and tilt of the remote to orbit around a model (while pressing the A and B buttons together). You can similarly use the walk tool to move through space and look around. I also mapped the up/down arrow keys to flip through animation tabs that may be in a model. Finally, the left/right arrow keys can be used to toggle shadows or x-ray mode on and off.

So whether you are doing a presentation in architecture class or are allowing clients to walk through their future house, this should give the audience a more intuitive way to navigate and evaluate the 3D model.

Once you look at how the GlovePIE code (below) works, you’ll see that you can easily modify this setup. It may be thinkable to use the Wiimote also for modeling, but precision may provide problems. Also, at this point, the code does not use the Wii infrared bar (or camera for that matter). If I find the time, I may implement this as a SketchUp plugin – that would likely add a degree of user friendliness to this.

Set Up:

  1. You already have SketchUp, don’t you? Otherwise get it from Google. Your computer must also have Bluetooth enabled.
  2. Get yourself a Wiimote. That’s just the Wii remote ($40), not the entire system.
  3. Install it in Windows. It’s all about setting it up to work with your computer’s Bluetooth adapter. For a guide, you may consult a nice and detailed how-to by Autodesk (or watch this video).
  4. Download GlovePIE. There’s no need to install it, just unzip the folder. It may even be possible to run it off a USB stick.
  5. Add the following key assignments in SketchUp. Do this in the Preferences dialog (Window menu) – see image below.
    Ctrl+Shift+X – View/Face Style/X-Ray
    Ctrl+Shift+T – View/Shadows
    Ctrl+W – Camera/Walk
  6. Open your model in SketchUp and leave it open.
  7. Paste the code below into GlovePIE and press the run button.
  8. Turn on the large screen projector, switch to SketchUp and play around with your new toy… er, “human interface device”.
SketchUp Wii Preferences
SketchUp Wii Preferences

This is the dialog in SketchUp where you can assign keyboard shortcuts. Feel free to modify the code below for your needs.

MAC USERS: I haven’t tried this on the mac yet. All instructions are for Windows. For Mac/Linux tools check out this article on Lifehacker.

Wii Remote Button Assignments:

Wiimote button assignments
Wiimote button assignments

These are the button assignments that work with the code below.

GlovePIE Code:

//  --------------------------------
//  Steer through SketchUp with a WiiMote
//  by: Alex Schreyer
//  web: www.alexschreyer.net
//  updated: 7/2/2008
//  Assign in SketchUp first (Window > Preferences):
//  Ctrl+Shift+X  - View/Face Style/X-Ray
//  Ctrl+Shift+T  - View/Shadows
//  Ctrl+W        - Camera/Walk
//  --------------------------------

// ===== Settings =====

  // How much to zoom
  var.Zoomfactor = 10

  // How much the wiimote needs to be tilted
  var.RollDegrees = 90
  var.PitchDegrees = 60

// ===== End of settings =====

// Show wiimote forces in GlovePIE - for monitoring
debug = "X="+Wiimote.gx+' Y='+Wiimote.gy+' Z='+Wiimote.gz

// Mouse Key Map
Mouse.RightButton = Wiimote.B and not Wiimote.A
Mouse.LeftButton = Wiimote.A and not Wiimote.B
Mouse.MiddleButton =  Wiimote.B and Wiimote.A

// Zoom
Mouse.WheelUp = var.Zoomfactor * Wiimote.Plus
Mouse.WheelDown = -var.Zoomfactor * Wiimote.Minus

// Track smooth movements, keep real mouse active, just in case
var.s_width = screen.Width
var.s_height = screen.Height
FakeMouse.DirectInputX = Smooth(Smooth(MapRange(Wiimote.Roll,-var.RollDegrees,var.RollDegrees,-var.s_width/2,var.s_width/2)))
FakeMouse.DirectInputY = Smooth(Smooth(MapRange(Wiimote.Pitch,-var.PitchDegrees,var.PitchDegrees,-var.s_height/2,var.s_height/2)))

// Animation tab control for presentations
PageUp = Wiimote.Down
PageDown = Wiimote.Up
// Toggle X-Ray mode
Ctrl+Shift+X = Wiimote.Right
// Toggle shadows
Ctrl+Shift+T = Wiimote.Left

// Switch Modes: Select (default) or Walk
Space = Wiimote.One
Ctrl+W = Wiimote.Two

// Reset cursor to center of screen - helps agains carpal tunnel
if Wiimote.Home then
  Cursor.PosX = var.s_width / 2
  Cursor.PosY = var.s_height / 2

Comments and Reactions