#!/usr/bin/perl
use lib '.';
require "pagelib.pl";
header();
head();

$dir = "images/motopod2";
if(!opendir(DIR,$dir)) {
    print "Internal error locating images!<br>\n";
}
@files = readdir(DIR);
foreach(@files) { push @images,$1 if(/(treadpod_[a-z]+)\.jpg/); }
foreach(@files) { push @images2,$1 if(/(tankpod_[a-z]+(1|2)?)\.jpg/); }
%used = ();

print qq`
<br><br>
<B><font size=+1>Treaded Tank Pod</font></B><br>
<br>
After my last <a href="motopod.cgi">Motopod</a>, I became inspired again,
this time to create a motorized pod using the Lego tank treads for mobility
rather than the pod "wheels". After experimenting with various gear wheels
assemblies, I happened upon a design that made a pretty round curve, and just
barely extented beyond the 8x8 radar dishes (which was necessary). Amazingly
enough, I even found I could use rubber bands to power the gears-- but sadly
the design never made it. The motor just wouldn't fit in the space
constraints, and even when put outside of them, wasn't strong enough to push
the tank treads once they were added.<br>
<br>
But despite its problems, I still thought it looked cool. So in true silly-pod
fashion, I added two grossly oversized weapons, and called it a day:
<br><br>\n
`;

#show_images(@images);
show_images('treadpod_left',
	    'treadpod_front',
	    'treadpod_right',
	    'treadpod_inside',
	    'treadpod_inangle',
	    'treadpod_guts',
	    );

print qq`
<br><br>
Determined to motorize it, though, I re-tooled the design with different gears,
a 2nd tread to provide steering, and of course, the ever important motors!
Fitting a non-disassembled minifig inside proved to be difficult without
expanding the model too much, so I let it stand without any real minifig access
points.
<br>
`;

show_images(
	    'tankpod_left',
	    'tankpod_front',
	    'tankpod_rear',
	    'tankpod_inside',
	    'tankpod_inside2',
	    'tankpod_guts',
	    );

print qq`
<br><br>For those of you who are bored and have a decent net connection (I'm
serious, it's probably not worth the download, but you're welcome to it!),
here\'s <a href=\"images/motopod2/tankpod_in_motion.mpg\">a 5.2M mpeg</a> of
the tank pod wandering around very slowly.<br>`;

foot();

sub show_images {
    my(@pics) = @_;
    my($i) = 0;
    print "<table width=100\%><tr>\n";
    foreach(@pics) {
	next if($used{$_});
	$used{$_} = 1;
	if(!($i++%4)) {
	    print "</tr>\n<tr>\n";
	}
	print "<td align=center><a href=\"$dir/$_.jpg\"><img src=\"$dir/$_\_th.jpg\" border=0></a></td>\n";
    }
    print "</tr></table>\n";
}
