<?xml version="1.0" encoding="utf-8"?>
<m3danim length="10">
  <video-clips>
    <random-movie-clip-playlist name="clips1" length="10" clip-length="3.33"/>
    <random-movie-clip-playlist name="clips2" length="10" clip-length="3.33"/>
    <random-movie-clip-playlist name="clips3" length="10" clip-length="3.33"/>
  </video-clips>

  <render-targets>
    <render-target texture="text" size="1024"/>
    <!--render-target texture="empty" size="1024"/-->
  </render-targets>

  <viewports>
    <viewport name="text" world="text">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
    <viewport name="cube" world="cube">
      <projection-transform>
        <perspective />
      </projection-transform>
    </viewport>
    <viewport name="menu" world="menu">
      <projection-transform>
        <menu-screen />
      </projection-transform>
    </viewport>
    <viewport name="empty" world="empty">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
  </viewports>

  <worlds>
    <world name="empty">

    </world>

    <world name="text">
      <container>
        <text text-id="disc.title" font-weight="bold" font-name="Arial Bold" font-size="80" align="center" valign="center" font-top-color="#FFa9d3ff" font-bottom-color="#FF3f75ac">
          My first self-encoded DVD!
        </text>
        <transforms>
          <scale x="1" y="1" />
        </transforms>
      </container>
    </world>


    <world name="cube">

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

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

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

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


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

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

    </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>


      <container>
        
        <container>
          <trianglestrip>
            <xyz>
              0.5   -0.5  1.0
              -0.5  -0.5  1.0
              0.5   0.5   1.0
              -0.5 0.5   1.0
            </xyz>
            <texcoord>
              1.0   1.0
              0.0   1.0
              1.0   0.0
              0.0   0.0
            </texcoord>
            <!--color>
              5FFFFFF
              5FFFFFF
              5FFFFFF
              5FFFFFF
            </color-->
            <texture render-target="text"/>
          </trianglestrip>
          <transforms>
            <translate x="0.5" y="0.1"/>
          </transforms>
        </container>
      </container>


      <container>
        <trianglestrip>
          <xyz>
            0.5   -0.5  1.0
            -0.5  -0.5  1.0
            0.5   0.5   1.0
            -0.5 0.5   1.0
          </xyz>
          <texcoord absolute="true">
            384   128
            0     128
            384   0
            0     0
          </texcoord>
          <texture static-src="button.png"/>
          <transforms>
            <translate x="0.15" y="0.835"/>
            <scale x="-0.3" y="-0.16"/>
          </transforms>
        </trianglestrip>
        <container>
          <container>
            <text text-id="button.play" font-weight="bold" font-name="Arial Bold" font-size="16" align="center" valign="center"  font-color="#FF000000">
              Play
            </text>
            <transforms>
              <translate x="0.001" y="0.002"/>
            </transforms>
          </container>
          <container>
            <text text-id="button.play" font-weight="bold" font-name="Arial Bold" font-size="16" align="center" valign="center" font-color="#FFFFFFFF">
              Play
            </text>
          </container>

          <transforms>
            <translate x="0.15" y="0.835"/>
          </transforms>
        </container>

      </container>



      <container>
        <trianglestrip>
          <xyz>
            0.5   -0.5  1.0
            -0.5  -0.5  1.0
            0.5   0.5   1.0
            -0.5 0.5  	1.0
          </xyz>
          <texcoord absolute="true">
            384   128
            0     128
            384   0
            0     0
          </texcoord>
          <texture static-src="button.png"/>
          <transforms>
            <translate x="0.85" y="0.835"/>
            <scale x="0.3" y="-0.16"/>
          </transforms>          
        </trianglestrip>
        <container>
          <container>
            <text text-id="button.scenes" font-weight="bold" font-name="Arial Bold" font-size="16" align="center" valign="center"  font-color="#FF000000">
              Scenes
            </text>
            <transforms>
              <translate x="0.001" y="0.002"/>
            </transforms>
          </container>
          <container>
            <text text-id="button.scenes" font-weight="bold" font-name="Arial Bold" font-size="16" align="center" valign="center" font-color="#FFFFFFFF">
              Scenes
            </text>
          </container>

          <transforms>
            <translate x="0.85" y="0.835"/>
          </transforms>
        </container>

      </container>

    </world>
  </worlds>
  <initial-render-instructions>
    <render-to clear-color="#00FFFFFF" texture="text" viewport="text"/>
  </initial-render-instructions>
  <render-instructions>
    <!--render-to clear-color="#00FFFFFF" texture="textshadow" viewport="empty"/>
    <render-to clear-color="#00FFFFFF" texture="text" viewport="empty"/>
    <render-to clear-color="#00FFFFFF" texture="empty" viewport="empty"/-->
    <render-to clear-depth="1" clear-color="#FF000000" buffer="back" viewport="menu"/>
    <render-to buffer="back" viewport="cube" />
  </render-instructions>
</m3danim>




