Piston and wheel mechanism issue

So I found this post:
http://blenderartists.org/forum/showthread.php?t=81088&highlight=piston

Which is fantastic, just what I needed, but… It only works in the Y-axis.

Could someone point me in the direction of how to rig such a mechanism that can be rotated in any orientation and still operate correctly?

This is a good piston tutorial.
http://download.blender.org/documentation/htmlI/ch16s10.html