Charles Petzold

3D Robot Walks and, umm, Walks Some More

February 15, 2007
New York, N.Y.

When I say "robot" I hope you're not visualizing some translucent smooth thing like in I Robot or AI. This is your basic tin-can kind of robot.

My original intent was to construct this figure out of a single shared GeometryModel3D defining a unit cube, and then scale, translate, and rotate the model in various ways, but I "cheated" a little and used four-sided pyramids for the eyes and ears.


The robot walks along an elliptical path defined as a two-dimensional PathGeometry resource. This resource is referenced in three DoubleAnimationUsingPath elements near the bottom of the file, controlling the robot's X and Z coordinates as it walks on the XZ plane, and it's rotation angle around the Y axis. (Unfortunately this technique cannot be generalized for any arbitrary movement in 3D space; one coordinate must remain constant.)

Once again, it's much preferable to run this file under Vista with Tier 2 hardware. Otherwise, the lack of anti-aliasing make the teeth and lips move around too much. Even with anti-aliasing, they still chatter a bit.