<?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"/>
  </video-clips>

  <render-targets>
    <render-target texture="cube0" size="256"/>
    <render-target texture="cube1" size="256"/>
    <render-target texture="cube2" size="256"/>
    <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="menu" world="menu">
      <projection-transform>
        <menu-screen/>
      </projection-transform>
    </viewport>
	
    <viewport name="cube0" world="cube0">
      <projection-transform>
        <perspective fov="60"/>
      </projection-transform>
    </viewport>


    <viewport name="cube1" world="cube1">
      <projection-transform>
        <perspective fov="60"/>
      </projection-transform>
    </viewport>

    <viewport name="cube2" world="cube2">
      <projection-transform>
        <perspective fov="60"/>
      </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>
        <text text-id="button.movie0" font-weight="bold" font-name="Arial Bold" font-size="30" align="center" valign="top" font-color="#FF55AAFF">
        </text>
        <transforms>
          <scale x="1" y="1" />
          <translate y="-1" />
        </transforms>
      </container>
    </world>

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

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

      <!-- front -->
      <rect>
        <texture video-clip="movie0"/>
        <transforms>
          <translate z="1"/>
        </transforms>
        <shader vertexshader="cube" pixelshader="../common/id">
          <float name="offset_z" value="-3.5" />
        </shader>
      </rect>

      <!-- back -->
      <rect>
        <texture video-clip="movie0"/>
        <transforms>
          <translate z="-1"/>
          <rotate-y angle="180" />
        </transforms>
        <shader vertexshader="cube" pixelshader="../common/id">
          <float name="offset_z" value="-3.5" />
        </shader>
        </rect>

        <!-- left -->
        <rect>
          <texture video-clip="movie0"/>
          <transforms>
            <translate x="-1"/>
            <rotate-y angle="-90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
          <float name="offset_z" value="-3.5" />
        </shader>
        </rect>

        <!-- right -->
        <rect>
          <texture video-clip="movie0" />
          <transforms>
            <translate x="1"/>
            <rotate-y angle="90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
          <float name="offset_z" value="-3.5" />
        </shader>
        </rect>


        <!-- top -->
        <rect>
          <texture video-clip="movie0"/>
          <transforms>
            <translate y="1"/>
            <rotate-x angle="-90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>

        <!-- bottom -->
        <rect>
          <texture video-clip="movie0"/>
          <transforms>
            <translate y="-1"/>
            <rotate-x angle="90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
          <float name="offset_z" value="-3.5" />
        </shader>
      </rect>

    </world>




    <world name="cube1">

      <if video-clip="movie1">

        <!-- front -->
        <rect>
          <texture video-clip="movie1"/>
          <transforms>
            <translate z="1"/>
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>

        <!-- back -->
        <rect>
          <texture video-clip="movie1"/>
          <transforms>
            <translate z="-1"/>
            <rotate-y angle="180" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>

        <!-- left -->
        <rect>
          <texture video-clip="movie1"/>
          <transforms>
            <translate x="-1"/>
            <rotate-y angle="-90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>

        <!-- right -->
        <rect>
          <texture video-clip="movie1" />
          <transforms>
            <translate x="1"/>
            <rotate-y angle="90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>


        <!-- top -->
        <rect>
          <texture video-clip="movie1"/>
          <transforms>
            <translate y="1"/>
            <rotate-x angle="-90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>

        <!-- bottom -->
        <rect>
          <texture video-clip="movie1"/>
          <transforms>
            <translate y="-1"/>
            <rotate-x angle="90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>

      </if>

    </world>

    <world name="cube2">

      <if video-clip="movie2">

        <!-- front -->
        <rect>
          <texture video-clip="movie2"/>
          <transforms>
            <translate z="1"/>
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>

        <!-- back -->
        <rect>
          <texture video-clip="movie2"/>
          <transforms>
            <translate z="-1"/>
            <rotate-y angle="180" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>

        <!-- left -->
        <rect>
          <texture video-clip="movie2"/>
          <transforms>
            <translate x="-1"/>
            <rotate-y angle="-90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>

        <!-- right -->
        <rect>
          <texture video-clip="movie2" />
          <transforms>
            <translate x="1"/>
            <rotate-y angle="90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>


        <!-- top -->
        <rect>
          <texture video-clip="movie2"/>
          <transforms>
            <translate y="1"/>
            <rotate-x angle="-90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>

        <!-- bottom -->
        <rect>
          <texture video-clip="movie2"/>
          <transforms>
            <translate y="-1"/>
            <rotate-x angle="90" />
          </transforms>
          <shader vertexshader="cube" pixelshader="../common/id">
            <float name="offset_z" value="-3.5" />
          </shader>
        </rect>
      </if>
    </world>

    <world name="menu">
      <trianglestrip>
        <xyz>
          3.3203125	-3.1	1.0
          -3.3203125	-3.1	1.0
          3.3203125	3.1		1.0
          -3.3203125	3.1 	1.0
        </xyz>
        <texcoord absolute="true">
          512   	0
          0		0
          512   	512
          0	    512
        </texcoord>

        <texture static-src="cubebg_light.png"/>
        <transforms>
        </transforms>
        <shader vertexshader="cubebg" pixelshader="../common/id">
          <float name="posOffsetX" value="0.5" />
          <float name="posOffsetY" value="0" />
          <float name="rotPeriod" value="10" />
          <float name="rotTimeOffset" value="2" />
          <float name="rotDir" value="1" />
          <float name="rotRadius" value="0.8" />
        </shader>
      </trianglestrip>

      <trianglestrip>
        <xyz>
          3.3203125	-3.1	1.0
          -3.3203125	-3.1	1.0
          3.3203125	3.1		1.0
          -3.3203125	3.1 	1.0
        </xyz>
        <texcoord absolute="true">
          512   	0
          0		0
          512   	512
          0	    512
        </texcoord>

        <texture static-src="cubebg_light.png"/>
        <transforms>
        </transforms>

        <shader vertexshader="cubebg" pixelshader="../common/id">
          <float name="posOffsetX" value="-0.5" />
          <float name="posOffsetY" value="0.5" />
          <float name="rotPeriod" value="10" />
          <float name="rotTimeOffset" value="4" />
          <float name="rotDir" value="-1" />
          <float name="rotRadius" value="1.4" />
        </shader>
      </trianglestrip>

      <trianglestrip>
        <xyz>
          3.3203125	-3.1	1.0
          -3.3203125	-3.1	1.0
          3.3203125	3.1		1.0
          -3.3203125	3.1 	1.0
        </xyz>
        <texcoord absolute="true">
          512   	0
          0		0
          512   	512
          0	    512
        </texcoord>

        <texture static-src="cubebg_dark.png"/>
        <transforms>
        </transforms>
        <shader vertexshader="cubebg" pixelshader="../common/id">
          <float name="posOffsetX" value="0" />
          <float name="posOffsetY" value="0" />
          <float name="rotPeriod" value="10" />
          <float name="rotTimeOffset" value="6" />
          <float name="rotDir" value="1" />
          <float name="rotRadius" value="1.5" />
        </shader>
      </trianglestrip>


      <trianglestrip>
        <xyz>
          3.3203125	-3.1	1.0
          -3.3203125	-3.1	1.0
          3.3203125	3.1		1.0
          -3.3203125	3.1 	1.0
        </xyz>
        <texcoord absolute="true">
          512   	0
          0		0
          512   	512
          0	    512
        </texcoord>

        <texture static-src="cubebg_dark.png"/>
        <transforms>
        </transforms>
        <shader vertexshader="cubebg" pixelshader="../common/id">
          <float name="posOffsetX" value="-0.3" />
          <float name="posOffsetY" value="0.7" />
          <float name="rotPeriod" value="10" />
          <float name="rotTimeOffset" value="2.5" />
          <float name="rotDir" value="-1" />
          <float name="rotRadius" value="1.7" />
        </shader>
      </trianglestrip>

      <trianglestrip>
        <xyz>
          3.3203125	-3.1	1.0
          -3.3203125	-3.1	1.0
          3.3203125	3.1		1.0
          -3.3203125	3.1 	1.0
        </xyz>
        <texcoord absolute="true">
          512   	0
          0		0
          512   	512
          0	    512
        </texcoord>

        <texture static-src="cubebg_dark.png"/>
        <transforms>
        </transforms>
        <shader vertexshader="cubebg" pixelshader="../common/id">
          <float name="posOffsetX" value="0.7" />
          <float name="posOffsetY" value="-1.0" />
          <float name="rotPeriod" value="10" />
          <float name="rotTimeOffset" value="1" />
          <float name="rotDir" value="1" />
          <float name="rotRadius" value="1" />
        </shader>
      </trianglestrip>

      <if video-clip="movie0">
        <container>

          <rect>
            <texture render-target="cube0"/>
            <transforms>
              <translate x="0.165" y="0.22"/>
              <scale x="0.165" y="-0.22"/>
            </transforms>
          </rect>

          <rect>
            <texture render-target="label_movie0"/>
            <transforms>
              <translate x="0.165" y="0.15"/>
              <scale x="0.15" y="0.20"/>
            </transforms>            
          </rect>
                    
          <transforms>
            <translate x="0.0" y="0.18"/>
          </transforms>
        </container>
      </if>

      <if video-clip="movie1">
        <container>       
          
          <rect>
            <texture render-target="cube1"/>
            <transforms>
              <translate x="0.165" y="0.22"/>
              <scale x="0.165" y="-0.22"/>
            </transforms>
          </rect>

          <rect>
            <texture render-target="label_movie1"/>
            <transforms>
              <translate x="0.165" y="0.15"/>
              <scale x="0.15" y="0.20"/>
            </transforms>
          </rect>
          
          
          <transforms>
            <translate x="0.33" y="0.18"/>
          </transforms>
        </container>
      </if>
      <if video-clip="movie2">
        <container>      
          
          <rect>
            <texture render-target="cube2"/>
            <transforms>
              <translate x="0.165" y="0.22"/>
              <scale x="0.165" y="-0.22"/>
            </transforms>
          </rect>

          <rect>
            <texture render-target="label_movie2"/>
            <transforms>
              <translate x="0.165" y="0.15"/>
              <scale x="0.15" y="0.20"/>
            </transforms>
          </rect>
          
          <transforms>
            <translate x="0.66" y="0.18"/>
          </transforms>
        </container>
      </if>

      <if bool="prevpage">
        <trianglestrip>
          <xyz>
            0.2		0.26666	1.0
            0.0   0.26666	1.0
            0.2		0.0		1.0
            0.0   0.0		1.0
          </xyz>
          <texcoord >
            1.0   1.0
            0.0    1.0
            1.0   0.0
            0.0    0.0
          </texcoord>
          <texture static-src="cubes_prev.png"/>
          <transforms>
            <translate x="0.1" y="0.7"/>
          </transforms>
        </trianglestrip>
      </if>

      <if bool="pageup">
        <trianglestrip>
          <xyz>
            0.2		0.26666	1.0
            0.0   0.26666	1.0
            0.2		0.0		1.0
            0.0   0.0		1.0
          </xyz>
          <texcoord >
            1.0   1.0
            0.0    1.0
            1.0   0.0
            0.0    0.0
          </texcoord>
          <texture static-src="cubes_up.png"/>
          <transforms>
            <translate x="0.4" y="0.7"/>
          </transforms>
        </trianglestrip>
      </if>

      
      <if bool="nextpage">
        <trianglestrip>
          <xyz>
            0.2		0.26666	1.0
            0.0   0.26666	1.0
            0.2		0.0		1.0
            0.0   0.0		1.0
          </xyz>
          <texcoord >
            1.0   1.0
            0.0    1.0
            1.0   0.0
            0.0    0.0
          </texcoord>
          <texture static-src="cubes_next.png"/>
          <transforms>
            <translate x="0.7" y="0.7"/>
          </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" clear-color="#00000000" texture="cube0" viewport="cube0"/>
    <render-to clear-depth="1" clear-color="#00000000" texture="cube1" viewport="cube1"/>
    <render-to clear-depth="1" clear-color="#00000000" texture="cube2" viewport="cube2"/>
    <render-to clear-color="#00000000" buffer="back" viewport="menu"/>
  </render-instructions>
</m3danim>
