#!perl -w
use CGI; my $cgi = new CGI;
my $counter = $cgi->param('counter');
if ($counter < 1) { $counter = 1; }
my $next = $counter + 1;

my $url = "default.pl?counter=$next";
if ($next > 100) {
	$url = "frame_done.pl?runs=100";

#my $ScreenWidth = Cookie("Humble")("ScreenWidth")
#my $ScreenHeight = Request.Cookies("Humble")("ScreenHeight")

}

print "Content-Type: image/svg+xml\r\n\r\n";
print <<EOF;
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Copyright&copy; 2005. Task Re-engineering Inc. All rights reserved. -->
<?xml-stylesheet href="/styles/SVG.css" type="text/css" ?>
<svg width="1003" height="593" viewBox="0 0 5000 2956.13160518445" version="1.1" preserveAspectRatio="xMinYMin slice" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" zoomAndPan="magnify">

  <defs>
    <pattern id="gridPattern" width="250" height="5.54274675972084" patternUnits="userSpaceOnUse" preserveAspectRatio="xMidYMid meet">
      <rect x="0" y="0" width="250" height="55.4274675972084" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    </pattern>
  </defs>



  <!-- *** Header: Heading *** -->
  <g transform="translate(250, 147.806580259222)">
    <text x="0" y="0" style="fill:red; font-size:125px;" startOffset="0">
	Side view, left side to the audience, at position on stage
    </text>
  </g>




  <!-- *** render stage apron grid *** -->
  <g transform="translate(0,2734.42173479561)">
    <rect fill="url(#gridPattern)" x="0" y="0" width="5000" height="55.4274675972084" style="stroke:red;fill-opacity:.2">
    </rect>
  </g>

  <!-- *** render stage apron centre and text *** -->
  <g transform="translate(2500,2734.42173479561)">
    <line x1="0" y1="0" x2="0" y2="41.6666666666667" style="stroke:red;stroke-width:5;"/>
    <line x1="-41.6666666666667" y1="0" x2="41.6666666666667" y2="0" style="stroke:red;stroke-width:5;"/>
    <text x="-41.6666666666667" y="41.6666666666667" style="fill:red; font-size:41.6666666666667px;" startOffset="0">
	0,0 (width=-2500mm to 2500mm; depth=0 to 10000mm)
    </text>
  </g>


  <!-- *** horizon line for stage rear *** -->
  <g transform="translate(1250,1734.42173479561)">
    <line x1="0" y1="0" x2="2500" y2="0" style="stroke:red;stroke-width:3;stroke-opacity:.5;"/>
    <line x1="0" y1="-5" x2="0" y2="5" style="stroke:red;stroke-width:3;"/>
    <line x1="1250" y1="-5" x2="1250" y2="5" style="stroke:red;stroke-width:3;"/>
    <line x1="2500" y1="-5" x2="2500" y2="5" style="stroke:red;stroke-width:3;"/>
  </g>

  <!-- *** render stage lines front to rear *** -->
  <g transform="translate(2500,1734.42173479561)">
    <line x1="0" y1="0" x2="0" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="-125" y1="0" x2="-250" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="-250" y1="0" x2="-500" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="-375" y1="0" x2="-750" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="-500" y1="0" x2="-1000" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="-625" y1="0" x2="-1250" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="-750" y1="0" x2="-1500" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="-875" y1="0" x2="-1750" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="-1000" y1="0" x2="-2000" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="-1125" y1="0" x2="-2250" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="-1250" y1="0" x2="-2500" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="125" y1="0" x2="250" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="250" y1="0" x2="500" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="375" y1="0" x2="750" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="500" y1="0" x2="1000" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="625" y1="0" x2="1250" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="750" y1="0" x2="1500" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="875" y1="0" x2="1750" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="1000" y1="0" x2="2000" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="1125" y1="0" x2="2250" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
    <line x1="1250" y1="0" x2="2500" y2="1000" style="fill:green;stroke:blue;stroke-width:1;fill-opacity:.2;"/>
  </g>



  <!-- *** render actor position on stage *** -->



  <!-- *** Footer: Viewer depth, actor position - to waist *** -->
  <g transform="translate(125, 2900.70413758724)">
    <text x="0" y="0" style="fill:red; font-size:62.5px;" startOffset="0">
	viewer at width=0, depth= -10000mm from front edge of stage, eye height = 2000mm above the stage;
	-- actor at width=2000mm, depth=100mm, and 1333mm to waist
    </text>
  </g>



<!--1 *** waist, centered on position on stage *** -->
<g transform="translate(4480.19801980198,1381.61975459759)">
 <circle cx="0" cy="0" r="100" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
<!-- rotate about position-pole forward_leaning *** -->
<g>
<animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="" values="0" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>


  <!--2a *** hips, do not rotate about waist *** -->
  <!--   also shift downward from the centre of the joint by 1/4 the diameter -->
  <g transform="translate(0,50)">

    <!--3a *** obscured (back) upper right leg: shift to bottom edge of the hip, then rotate at the hip-joint *** -->
    <g transform="translate(0,225)">
    <circle cx="0" cy="0" r="50" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
    <g>
    <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="35; -35;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
    <g transform="translate(0,25)">
     <rect x="-75" y="0" width="150" height="460" style="stroke:black;fill:brown;fill-opacity:.3;"/>

      <!--4a *** obscured (back) lower right leg: shift to bottom edge of the upper leg, then rotate at the knee-joint *** -->
      <g transform="translate(0,485)">
      <circle cx="0" cy="0" r="50" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
      <g>
      <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="0; 0;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
      <g transform="translate(0,25)">
       <rect x="-50" y="0" width="100" height="400" style="stroke:black;fill:brown;fill-opacity:.3;"/>

        <!--5a *** obscured (back) right foot: shift to bottom edge of the lower leg, then rotate at the ankle-joint *** -->
        <g transform="translate(0,422.5)">
        <circle cx="0" cy="0" r="45" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
        <g>
        <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="0; 0;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
        <g transform="translate(0,22.5)">
         <rect x="-189" y="0" width="270" height="70" style="stroke:black;fill:brown;fill-opacity:.3;"/>

        </g></g></g><!--/5a *** obscured right foot *** -->
      </g></g></g><!--/4a *** obscured lower leg *** -->
    </g></g></g><!--/3a *** obscured upper leg *** -->

  <!--2a *** hips *** -->
   <rect x="-120" y="0" width="240" height="200" style="stroke:black;fill:blue;fill-opacity:.3;"/>

    <!--3b *** front upper right leg: shift to bottom edge of the hip, then rotate at the hip-joint *** -->
    <g transform="translate(0,225)">
    <circle cx="0" cy="0" r="50" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
    <g>
    <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; .2; .8; 1;" values="-35; -30; 30; 35;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
    <g transform="translate(0,25)">
     <rect x="-75" y="0" width="150" height="460" style="stroke:black;fill:brown;fill-opacity:.3;"/>

      <!--4b *** front lower right leg: shift to bottom edge of the upper leg, then rotate at the knee-joint *** -->
      <g transform="translate(0,485)">
      <circle cx="0" cy="0" r="50" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
      <g>
      <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; .2; .8; 1;" values="-5; -35; -35; -5;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
      <g transform="translate(0,25)">
       <rect x="-50" y="0" width="100" height="400" style="stroke:black;fill:brown;fill-opacity:.3;"/>

        <!--5b *** front right foot: shift to bottom edge of the lower leg, then rotate at the ankle-joint *** -->
        <g transform="translate(0,422.5)">
        <circle cx="0" cy="0" r="45" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
        <g>
        <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="0; 0;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
        <g transform="translate(0,22.5)">
         <rect x="-189" y="0" width="270" height="70" style="stroke:black;fill:brown;fill-opacity:.3;"/>

        </g></g></g><!--/5b *** front right foot *** -->
      </g></g></g><!--/4b *** front lower leg *** -->
    </g></g></g><!--/3b *** front upper leg *** -->
  </g><!--/2a *** hips *** -->


  <!--2c *** shoulders, rotate about waist, using waist_forward_angle *** -->
  <g>
  <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="0; 0;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
  <g transform="translate(0,-50)">

    <!--3c *** obscured (back) upper right arm: shift to top edge of the shoulder, then rotate at the shoulder-joint *** -->
    <g transform="translate(0,-290)">
    <circle cx="0" cy="0" r="40" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
    <g>
    <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="-45; 30;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
    <g transform="translate(0,20)">
     <rect x="-55" y="0" width="110" height="380" style="stroke:black;fill:brown;fill-opacity:.3;"/>

      <!--4c *** obscured (back) lower right arm: shift to bottom edge of the upper arm, then rotate at the elbow-joint *** -->
      <g transform="translate(0,405)">
      <circle cx="0" cy="0" r="50" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
      <g>
      <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="65; 45;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
      <g transform="translate(0,25)">
       <rect x="-45" y="0" width="90" height="260" style="stroke:black;fill:brown;fill-opacity:.3;"/>

        <!--5c *** obscured (back) right hand: shift to bottom edge of the lower arm, then rotate at the wrist-joint *** -->
        <g transform="translate(0,280)">
        <circle cx="0" cy="0" r="40" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
        <g>
        <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="0; 0;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
        <g transform="translate(0,20)">
         <rect x="-60" y="0" width="120" height="200" style="stroke:black;fill:brown;fill-opacity:.3;"/>

        </g></g></g><!--/5c *** obscured right hand *** -->
      </g></g></g><!--/4c *** obscured lower arm *** -->
    </g></g></g><!--/3c *** obscured upper arm *** -->

  <!--2c *** shoulders *** -->
   <rect x="-125" y="-330" width="250" height="330" style="stroke:black;fill:blue;fill-opacity:.3;"/>

    <!--3d *** front upper left arm: shift to top edge of the shoulder, then rotate at the shoulder-joint *** -->
    <g transform="translate(0,-290)">
    <circle cx="0" cy="0" r="40" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
    <g>
    <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="30; -45;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
    <g transform="translate(0,20)">
     <rect x="-55" y="0" width="110" height="380" style="stroke:black;fill:brown;fill-opacity:.3;"/>

      <!--4d *** front lower left arm: shift to bottom edge of the upper arm, then rotate at the elbow-joint *** -->
      <g transform="translate(0,405)">
      <circle cx="0" cy="0" r="50" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
      <g>
      <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="45; 65;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
      <g transform="translate(0,25)">
       <rect x="-45" y="0" width="90" height="260" style="stroke:black;fill:brown;fill-opacity:.3;"/>

        <!--5d *** front left hand: shift to bottom edge of the lower arm, then rotate at the wrist-joint *** -->
        <g transform="translate(0,280)">
        <circle cx="0" cy="0" r="40" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
        <g>
        <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="0; 0;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
        <g transform="translate(0,20)">
         <rect x="-60" y="0" width="120" height="200" style="stroke:black;fill:brown;fill-opacity:.3;"/>

        </g></g></g><!--/5d *** front left hand *** -->
      </g></g></g><!--/4d *** front lower arm *** -->
    </g></g></g><!--/3d *** front upper arm *** -->

    <!--3e *** head on neck: shift to top edge of the shoulder, then rotate at the neck *** -->
    <g transform="translate(0,-357.5)">
    <circle cx="0" cy="0" r="55" style="stroke:black;fill:yellow;fill-opacity:.3;"/>
    <g>
    <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; .25; .5; .75; 1;" values="0; -10; 0; 10; 0;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
    <g transform="translate(55,-27.5)">
     <rect x="-180" y="-250" width="180" height="250" style="stroke:black;fill:brown;fill-opacity:.3;"/>

      <!--4e *** single eye: shift to front of head, position below top, then rotate the eye for viewpoint of eyes *** -->
      <g transform="translate(-180,-162.5)">
      <circle cx="0" cy="0" r="20" style="stroke:black;fill:red;fill-opacity:.7;"/>
      <g>
      <animateTransform attributeType="XML" attributeName="transform" type="rotate" keyTimes="0; 1;" values="0; 0;" dur="5s" fill="freeze" accumulate="none" additive="replace" calcMode="linear" restart="always"/>
       <line x1="0" y1="0" x2="-800" y2="0" stroke="red"/>
       <text x="-800" y="-20" fill="black" font-size="31.25px" startOffset="0">line of sight</text>

      </g></g><!--/4e *** eye *** -->
    </g></g></g><!--/3e *** head on neck *** -->

  </g></g><!--/2c *** shoulders *** -->

</g></g><!--/1 *** waist *** -->



  <!-- *** page-to-page navigation *** -->
  <g transform="translate(4630,25)">
    <a xlink:href="toc_top.htm">
    <image xlink:href="/images/previous_page.gif" x="0" y="0" width="100" height="100"/>
    </a><a xlink:href="toc_top.htm">
    <image xlink:href="/images/TOC_page.gif" x="120" y="0" width="100" height="100"/>
    </a><a xlink:href="toc_top.htm">
    <image xlink:href="/images/next_page.gif" x="240" y="0" width="100" height="100"/>
    </a>
  </g>


</svg>


EOF

