3d: rewrite the frame code to fix a couple of additional weird bugs.  Just do it the hard way.
3d: rewrite the frame code to fix a couple of additional weird bugs.  Just do it the hard way.

tscholl2/smc,tscholl2/smc,DrXyzzy/smc,tscholl2/smc,sagemathinc/smc,sagemathinc/smc,DrXyzzy/smc,sagemathinc/smc,tscholl2/smc,tscholl2/smc,sagemathinc/smc,DrXyzzy/smc,DrXyzzy/smc