Animating SketchUp Models
in Ruby and Java
Brad J. Cox, Ph.D.
Binary Consulting; Bethesda MD.
May 19, 2006
This describes two approaches to animating 3D models constructed in Sketchup.
  1. Animating Sketchup models in Ruby uses Sketchup’s embedded Ruby programming language to animate models as they reside inside Sketchup. In effect, Sketchup becomes the animation engine. Although this proved feasible, the approach was ultimately abandoned for the reasons explained at the end of that document.
  2. Animating SketchUp Models with Java describes how to export visual models via the .obj format into the JME (Java Monkey) game engine for animation in Java. This approach is still underway but is temporarily on hold due to other demands on my time.
This document describes the aspects that the two approaches share in common. Both approaches are based on the theoretical model described in Marco Kogler’s thesis, Simulation and Visualization of Agents in 3D Environments.
I claim no special expertise in either Ruby, Sketchup or games. I'm simply learning how to do it a step at the time and documenting my progress for those who might follow. If you spot errors or know of better solutions, let me know at The information is specific to Mac OS X but can be modified work on other platforms.
SketchUp provides several ways of animating static models that are easier than those described here. However they don’t support dynamic models that exercise their own behavior; the ability to build dynamic models that move on their own volition.
The figure at the top shows the scenario I’m developing. The goal is to animate the dynamic elements in this picture, or agents (crew, airplanes, bombs, torpedoes, etc) against the background of the static objects (landing strip, control tower, hangar, quarters). This involves giving each of the dynamic elements enough 'artificial intelligence' to govern their movements internally, influenced by their interactions with other elements of the simulation.
The example was motivated by the situation Japanese Admiral Nagumo faced in the Battle of Midway. While rearming his planes with bombs for a second attack on Midway, his carriers were discovered by planes from three American aircraft carriers. His planes, mostly rearmed with bombs by this point, had to be rearmed with torpedoes during the attack, leaving the decks littered with bombs. These exploded and four of his carriers were sunk. Since the goal is not to build a accurate animation of this particular battle, the picture shows a conventional (flat, 2D) airfield to delay having to deal with a carrier's 3-dimensional structure until later.