<?xml version="1.0" encoding="utf-8"?>
<m3danim length="10">
  <video-clips>
    <random-movie-clip-playlist name="movie0" only-from="movie0" length="10" clip-length="3.33"/>
    <random-movie-clip-playlist name="movie1" only-from="movie1" length="10" clip-length="3.33"/>
    <random-movie-clip-playlist name="movie2" only-from="movie2" length="10" clip-length="3.33"/>

    <random-movie-clip-playlist name="clips1" length="10" clip-length="3.33"/>
    <random-movie-clip-playlist name="clips2" length="10" clip-length="3.33" offset="0.25" />
    <random-movie-clip-playlist name="clips3" length="10" clip-length="3.33" offset="0.5" />
    <random-movie-clip-playlist name="clips4" length="10" clip-length="3.33" offset="0.75" />
  </video-clips>


  <render-targets>
    <render-target texture="scene[0]" size="1024" initial-color="#FF000000"/>
    <render-target texture="scene[1]" size="1024" initial-color="#FF000000"/>
    <render-target texture="label_movie0" size="256"/>
    <render-target texture="label_movie1" size="256"/>
    <render-target texture="label_movie2" size="256"/>
  </render-targets>

  <viewports>
    <viewport name="blend-scene[0]" world="blend-scene[0]">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
    <viewport name="scene[0]" world="scene[0]">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
    <viewport name="new-scene-background" world="new-scene-background">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
    <viewport name="scene" world="scene">
      <projection-transform>
        <perspective />
      </projection-transform>
    </viewport>
    <viewport name="menu" world="menu">
      <projection-transform>
        <perspective fov="100"/>
      </projection-transform>
      <view-transform>
        <lookat>
          <eye>0.0 0.0 4.0</eye>
          <at>0.0 0.0 0.0</at>
          <up>0.0 1.0 0.0</up>
        </lookat>
      </view-transform>
    </viewport>
    <viewport name="background" world="background">
      <projection-transform>
        <perspective />
      </projection-transform>
    </viewport>

    <viewport name="label_movie0" world="label_movie0">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
    <viewport name="label_movie1" world="label_movie1">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
    <viewport name="label_movie2" world="label_movie2">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>


  </viewports>
  <worlds>

    <world name="label_movie0">

      <container>

        <array count="3">
          <array count="3">

            <text text-id="button.movie0" font-weight="bold" font-name="Arial Bold" font-size="36" align="center" valign="top" font-color="#FF76788E">
            </text>
            <transforms>
              <scale x="1" y="1" />
              <translate y="-1" x="-0.007" />
            </transforms>

            <step-transforms>
              <translate x="0.007"/>
            </step-transforms>

          </array>

          <transforms>
            <translate y="-0.007"/>
          </transforms>

          <step-transforms>
            <translate y="0.007"/>
          </step-transforms>

        </array>

      </container>
      
      
      <container>
        <text text-id="button.movie0" font-weight="bold" font-name="Arial Bold" font-size="36" align="center" valign="top" font-color="#FFF4F5FF">
        </text>
        <transforms>
          <scale x="1" y="1" />
          <translate y="-1" />
        </transforms>
      </container>
    </world>

    <world name="label_movie1">

      <container>

        <array count="3">
          <array count="3">

            <text text-id="button.movie1" font-weight="bold" font-name="Arial Bold" font-size="36" align="center" valign="top" font-color="#FF76788E">
            </text>
            <transforms>
              <scale x="1" y="1" />
              <translate y="-1" x="-0.007" />
            </transforms>

            <step-transforms>
              <translate x="0.007"/>
            </step-transforms>

          </array>

          <transforms>
            <translate y="-0.007"/>
          </transforms>

          <step-transforms>
            <translate y="0.007"/>
          </step-transforms>

        </array>

      </container>

      <container>

        <text text-id="button.movie1" font-weight="bold" font-name="Arial Bold" font-size="36" align="center" valign="top" font-color="#FFF4F5FF">
        </text>
        <transforms>
          <scale x="1" y="1" />
          <translate y="-1" />
        </transforms>
            
      </container>
    </world>

    <world name="label_movie2">

      <container>

        <array count="3">
          <array count="3">

            <text text-id="button.movie2" font-weight="bold" font-name="Arial Bold" font-size="36" align="center" valign="top" font-color="#FF76788E">
            </text>
            <transforms>
              <scale x="1" y="1" />
              <translate y="-1" x="-0.007" />
            </transforms>

            <step-transforms>
              <translate x="0.007"/>
            </step-transforms>

          </array>

          <transforms>
            <translate y="-0.007"/>
          </transforms>

          <step-transforms>
            <translate y="0.007"/>
          </step-transforms>

        </array>

      </container>
      
      <container>
        <text text-id="button.movie2" font-weight="bold" font-name="Arial Bold" font-size="36" align="center" valign="top" font-color="#FFF4F5FF">
        </text>
        <transforms>
          <scale x="1" y="1" />
          <translate y="-1" />
        </transforms>
      </container>
    </world>

    <world name="background">
      <rect>
        <texture static-src="bg.png"/>
        <transforms>
          <translate z="-0.9"/>
          <scale x="1.9" y="1.9"/>
        </transforms>
        <shader vertexshader="bgmove" pixelshader="../common/id">
          <float name="rot_speed" value="1"/>
        </shader>
      </rect>
      <rect>
        <texture static-src="bg.png"/>
        <transforms>
          <translate z="-0.9"/>
          <scale x="1.9" y="1.9"/>
        </transforms>
        <shader vertexshader="bgmove" pixelshader="blendovertime">
          <float name="rot_speed" value="2"/>
          <float name="blend_end" value="0.4"/>
          <float name="blend_start" value="0.4"/>
          <!--float name="zoom_factor" value="0.7"/-->
        </shader>
      </rect>
    </world>

    <world name="scene">
      <rect>
        <texture video-clip="clips1"/>
        <transforms>
          <translate y="2"/>
          <rotate-x angle="90" />
        </transforms>
        <shader vertexshader="wallmove" pixelshader="wallmove">
          <float name="start_offset" value="0" />
        </shader>
      </rect>

      <rect>
        <texture video-clip="clips2"/>
        <transforms>
          <translate y="-2"/>
          <rotate-x angle="-90" />
        </transforms>
        <shader vertexshader="wallmove" pixelshader="wallmove">
          <float name="start_offset" value="0.25" />
        </shader>
      </rect>

      <rect>
        <texture video-clip="clips3"/>
        <transforms>
          <translate x="1"/>
          <rotate-y angle="-90" />
        </transforms>
        <shader vertexshader="wallmove" pixelshader="wallmove">
          <float name="start_offset" value="0.5" />
        </shader>
      </rect>

      <rect>
        <texture video-clip="clips4"/>
        <transforms>
          <translate x="-1"/>
          <rotate-y angle="90" />
        </transforms>
        <shader vertexshader="wallmove" pixelshader="wallmove">
          <float name="start_offset" value="0.75" />
        </shader>
      </rect>
    </world>
    <world name="blend-scene[0]">
      <rect>
        <color>
          CCFFFFFF
          CCFFFFFF
          CCFFFFFF
          CCFFFFFF
        </color>
        <texture render-target="scene[0]"/>
      </rect>
    </world>
    <world name="scene[0]">
      <rect>
        <texture render-target="scene[0]"/>
        <transforms>
          <translate z="1"/>
        </transforms>
      </rect>
    </world>
    <world name="new-scene-background">
      <rect>
        <texture render-target="scene[1]"/>
      </rect>
    </world>


    <world name="menu">
      <container>
        
        <if video-clip="movie0">
          <container>
            <rect>
              <texture video-clip="movie0"/>
              <transforms>
                <scale x="0.312" y="0.312"/>
				<translate z="-0.001"/>
              </transforms>
            </rect>
            <trianglestrip>
              <xyz>
                0.5   -0.5  0.0
                -0.5  -0.5  0.0
                0.5   0.5   0.0
                -0.5  0.5   0.0
              </xyz>
              <texcoord>
                1.0   1.0
                0     1.0
                1.0   0
                0     0
              </texcoord>
              <texture static-src="border.png"/>
            </trianglestrip>

            <trianglestrip>
              <xyz>
                0.5   -0.5  0.0
                -0.5  -0.5  0.0
                0.5   0.5   0.0
                -0.5  0.5   0.0
              </xyz>
              <texcoord>
                1.0   0.0
                0.0   0.0
                1.0   1.0
                0.0   1.0
              </texcoord>
              <texture render-target="label_movie0"/>
              <transforms>
                <translate z="0.01" y="0.08" />
                <scale y="0.75" x="0.75" />
              </transforms>
            </trianglestrip>
            
            
            <transforms>
              <scale x="8" y="8"/>
              <translate z="-1" x="-.9"/>
              <translate x="0.5"/>
              <rotate-y angle="65"/>
              <translate x="-0.5"/>
            </transforms>
          </container>
        </if>


        <if video-clip="movie1">
          <container>
            <rect>
              <texture video-clip="movie1"/>
              <transforms>
                <scale x="0.312" y="0.312"/>
              </transforms>
            </rect>

            <trianglestrip>
              <xyz>
                0.5   -0.5  0.0
                -0.5  -0.5  0.0
                0.5   0.5   0.0
                -0.5  0.5   0.0
              </xyz>
              <texcoord>
                1.0   1.0
                0     1.0
                1.0   0
                0     0
              </texcoord>
              <texture static-src="border_mid.png"/>
            </trianglestrip>

            <trianglestrip>
              <xyz>
                0.5   -0.5  0.0
                -0.5  -0.5  0.0
                0.5   0.5   0.0
                -0.5  0.5   0.0
              </xyz>
              <texcoord>
                1.0   0.0
                0.0   0.0
                1.0   1.0
                0.0   1.0
              </texcoord>
              <texture render-target="label_movie1"/>
              <transforms>
                <translate y="0.08" />
                <scale y="0.75" x="0.75" />
              </transforms>
            </trianglestrip>

            <transforms>
              <scale x="8" y="8"/>
              <translate z="-1"/>
            </transforms>
          </container>
        </if>
        
        <if video-clip="movie2">
          <container>
            <rect>
              <texture video-clip="movie2"/>
              <transforms>
                <scale x="0.312" y="0.312"/>
				<translate z="-0.001"/>
              </transforms>
            </rect>
            <trianglestrip>
              <xyz>
                0.5   -0.5  0.0
                -0.5  -0.5  0.0
                0.5   0.5   0.0
                -0.5  0.5   0.0
              </xyz>
              <texcoord>
                1.0   1.0
                0     1.0
                1.0   0
                0     0
              </texcoord>
              <texture static-src="border.png"/>
              <transforms>
                <scale x="-1"/>
              </transforms>
            </trianglestrip>

            <trianglestrip>
              <xyz>
                0.5   -0.5  0.0
                -0.5  -0.5  0.0
                0.5   0.5   0.0
                -0.5  0.5   0.0
              </xyz>
              <texcoord>
                1.0   0.0
                0.0   0.0
                1.0   1.0
                0.0   1.0
              </texcoord>
              <texture render-target="label_movie2"/>
              <transforms>
                <translate z="0.01" y="0.08" />
                <scale y="0.75" x="0.75" />
              </transforms>
            </trianglestrip>
            
            <transforms>
              <scale x="8" y="8"/>
              <translate z="-1.0" x=".9"/>
              <translate x="-0.5"/>
              <rotate-y angle="-65"/>
              <translate x="0.5"/>
            </transforms>
          </container>
        </if>
        <transforms>
          <translate y="0.5"/>
        </transforms>
      </container>

      <if bool="pageup">
        <trianglestrip>
          <xyz>
            0.5   -0.5  0.0
            -0.5  -0.5  0.0
            0.5   0.5   0.0
            -0.5  0.5   0.0
          </xyz>
          <texcoord>
            1.0   1.0
            0     1.0
            1.0   0
            0     0
          </texcoord>
          <texture static-src="scene_but_m.png"/>
          <transforms>
            <scale x="5" y="2.5"/>
            <translate y="-2"z="-1"/>
          </transforms>
        </trianglestrip>
      </if>

      <if bool="nextpage">
        <trianglestrip>
          <xyz>
            0.5   -0.5  0.0
            -0.5  -0.5  0.0
            0.5   0.5   0.0
            -0.5  0.5   0.0
          </xyz>
          <texcoord>
            1.0   1.0
            0     1.0
            1.0   0
            0     0
          </texcoord>
          <texture static-src="scene_but_r.png"/>
          <transforms>
            <scale x="5" y="2.5"/>
            <translate x="0.5" y="-2"z="-1"/>
          </transforms>
        </trianglestrip>
      </if>

      <if bool="prevpage">
        <trianglestrip>
          <xyz>
            0.5   -0.5  0.0
            -0.5  -0.5  0.0
            0.5   0.5   0.0
            -0.5  0.5   0.0
          </xyz>
          <texcoord>
            1.0   1.0
            0     1.0
            1.0   0
            0     0
          </texcoord>
          <texture static-src="scene_but_l.png"/>
          <transforms>
            <scale x="5" y="2.5"/>
            <translate x="-0.5" y="-2"z="-1"/>
          </transforms>
        </trianglestrip>
      </if>
    </world>
  </worlds>

  <initial-render-instructions>
    <render-to clear-color="#00FFFFFF" texture="label_movie0" viewport="label_movie0"/>
    <render-to clear-color="#00FFFFFF" texture="label_movie1" viewport="label_movie1"/>
    <render-to clear-color="#00FFFFFF" texture="label_movie2" viewport="label_movie2"/>
  </initial-render-instructions>

  <render-instructions>
    <render-to clear-depth="1" texture="scene[1]" viewport="blend-scene[0]"/>
    <render-to clear-depth="1" clear-color="#00FFFFFF" texture="scene[0]" viewport="new-scene-background"/>
    <render-to clear-depth="1" texture="scene[0]" viewport="scene"/>
    <render-to clear-depth="1" clear-color="#FF000000" buffer="back" viewport="background"/>
    <render-to buffer="back" viewport="scene[0]"/>
    <render-to buffer="back" viewport="menu"/>
  </render-instructions>
</m3danim>
