<?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"/>
    <random-movie-clip-playlist name="clips4" length="10" clip-length="3.33"/>
  </video-clips>

  <render-targets>
    <render-target texture="textshadow" size="1024"/>
    <render-target texture="text" size="1024"/>
    <render-target texture="videowalls" size="1024"/>
  </render-targets>
  
  <viewports>
    <viewport name="menu" world="menu">
      <projection-transform>
        <menu-screen />
      </projection-transform>
    </viewport>

    <viewport name="background" world="background">
      <projection-transform>
        <menu-screen />
      </projection-transform>
    </viewport>	
	
    <viewport name="helperoverlay" world="helperoverlay">
      <projection-transform>
        <menu-screen />
      </projection-transform>
    </viewport>
	
    <viewport name="videowalls" world="videowalls">
      <projection-transform>
        <perspective fov="60.0"/>
      </projection-transform>
	  <view-transform>
		  <lookat>
			<eye>0.0 1.0 6.0</eye>
			<at>0.0 -0.3 -4.2</at>
			<up>0.0 1.0 0.0</up>
		  </lookat>
	   </view-transform>
    </viewport>
    <viewport name="textshadow" world="textshadow">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
    <viewport name="text" world="text">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
  </viewports>

  
  
  <worlds> 
	<world name="helperoverlay">
		<!--trianglestrip>
			<xyz>
				0.0	0.0	0.0
				1.0 0.0	0.0
				0.0	1.0	0.0
				1.0	1.0	0.0
			</xyz>

			<color>
				40FFFFFF
				40FFFFFF
				40FFFFFF
				40FFFFFF
			</color>
		</trianglestrip-->	
	</world>

	<world name="background">
		<trianglestrip>
			<xyz>
				1.3203125	-0.1	1.0
				-0.3203125	-0.1	1.0
				1.3203125	1.1		1.0
				-0.3203125	1.1 	1.0
			</xyz>
			<texcoord absolute="true">
				933   	0
				0		0
				933   	512
				0	    512
			</texcoord>
			
			<texture static-src="bg.png"/>
			<transforms>
			</transforms>
		</trianglestrip>
	</world>
	
	<world name="menu">
		<trianglestrip>
			<xyz>
				1.3		1.56666	1.0
				-0.3	1.56666	1.0
				1.3		-0.5666 1.0
				-0.3	-0.5666	1.0
			</xyz>
			<texcoord>
				1.0   1.0
				0.0   1.0
				1.0   0.0
				0.0   0.0
			</texcoord>
			<texture render-target="videowalls"/>
		</trianglestrip>			

		<trianglestrip>
			<xyz>
				1.3		1.56666	1.0
				-0.3	1.56666	1.0
				1.3		-0.5666 1.0
				-0.3	-0.5666	1.0
			</xyz>
			<texcoord>
				1.0   0.0
				0.0   0.0
				1.0   1.0
				0.0   1.0
			</texcoord>
			<texture render-target="text"/>
		</trianglestrip>
    </world>

    <world name="text">
		<container>
			<text text-id="disc.title" font-weight="bold" font-name="Arial Bold" font-size="70" align="center" valign="center" font-top-color="#FFFFFFFF" font-bottom-color="#FFFFFFFF">
				My first self-encoded DVD!
			</text>
			<transforms>
				<scale x="1" y="1" />
				<translate y="-0.4"/>
			</transforms>
		</container>
		<container>	
			<text text-id="button.play" font-weight="bold" font-name="Arial Bold" font-size="50" align="center" valign="center" font-top-color="#FFFFFFFF" font-bottom-color="#FFFFFFFF">
				Play
	        </text>
	        <transforms>
	          <scale x="1" y="1" />
			  <translate y="0.28" x="-0.3"/>
	       </transforms>
		</container>
		<container>	
			<text text-id="button.scenes" font-weight="bold" font-name="Arial Bold" font-size="50" align="center" valign="center" font-top-color="#FFFFFFFF" font-bottom-color="#FFFFFFFF">
				Scenes
	        </text>
	        <transforms>
	          <scale x="1" y="1" />
			  <translate y="0.28" x="0.3"/>
	       </transforms>
		</container>

	  </world>	
	
    <world name="textshadow">
      <container>
        <text text-id="disc.title" font-weight="bold" font-name="Arial Bold" font-size="70" align="center" valign="center" font-color="#FFFFFFFF">
          My first self-encoded DVD!
        </text>
        <transforms>
          <scale x="1" y="1" />
        </transforms>
      </container>
    </world>
	
	<world name="videowalls">
		<container>
			<transforms>
				<translate z="-10.0" y="0.0"/>
				<scale y="1.0"/>
				<!--rotate-x angle="15.0"/-->
			</transforms>
			
			<container>
				<transforms>
					<scale x="1.5" y="1.5"/>
					<translate x="-0.5"/>
					<translate x="-1.5" y="0.0"/>
				</transforms>
				
				<trianglestrip>
					<xyz>
						0.0	0.0	0.0
						1.0 0.0	0.0
						0.0	1.0	0.0
						1.0	1.0	0.0
					</xyz>
					
					<texcoord absolute="true">
						1024   	0
						0		0
						1024   	960
						0	    960
					</texcoord>
					<texture static-src="gridder_wall1.png"/>
					
					<texcoord absolute="false">
						0.0   	1.0
						1.0		1.0
						0.0   	0.0
						1.0	    0.0
					</texcoord>				
					<texture video-clip="clips1"/>
					<texcoord absolute="false"/>
					<texture static-src="hsvgrad.png"/>
					
					<shader vertexshader="normal2Tex4Video" pixelshader="videowalloverlay">
						<float name="VideoTexCoordScaleX" value="10.0" />
						<float name="VideoTexCoordScaleY" value="10.0" />
						<float name="VideoTexCoordMoveX" value="5.5" />
						<float name="VideoTexCoordMoveY" value="5.5" />
					</shader>				
				</trianglestrip>
				<trianglestrip>
					<transforms>
						<scale y="-1.0"/>
					</transforms>
					<xyz>
						0.0	0.0	0.0
						1.0 0.0	0.0
						0.0	1.0	0.0
						1.0	1.0	0.0
					</xyz>
					
					<texcoord absolute="true">
						1024   	0
						0		0
						1024   	960
						0	    960
					</texcoord>
					<texture static-src="gridder_wall1.png"/>
					
					<texcoord absolute="false">
						0.0   	1.0
						1.0		1.0
						0.0   	0.0
						1.0	    0.0
					</texcoord>				
					<texture video-clip="clips1"/>
					<texcoord absolute="false">
						0.0   	0.3
						1.0		0.3
						0.0   	1.0
						1.0	    1.0						
					</texcoord>
					<texture static-src="mirroralpha.png"/>

					<texcoord absolute="false"/>
					<texture static-src="hsvgrad.png"/>
					
					<shader vertexshader="normal3Tex4Video" pixelshader="videowalloverlay-mirror">
						<float name="VideoTexCoordScaleX" value="10.0" />
						<float name="VideoTexCoordScaleY" value="10.0" />
						<float name="VideoTexCoordMoveX" value="5.5" />
						<float name="VideoTexCoordMoveY" value="5.5" />
					</shader>				
				</trianglestrip>				
			</container>
			
			<container>
				<transforms>
					<scale x="1.5" y="1.5"/>
					<translate x="-0.5"/>
					<translate x="1.5" y="0.0"/>
				</transforms>			
				<trianglestrip>
					<xyz>
						0.0	0.0	0.0
						1.0 0.0	0.0
						0.0	1.0	0.0
						1.0	1.0	0.0
					</xyz>
					
					<texcoord absolute="true">
						1024   	0
						0		0
						1024   	960
						0	    960
					</texcoord>
					<texture static-src="gridder_wall2.png"/>
					
					<texcoord absolute="false">
						0.0   	1.0
						1.0		1.0
						0.0   	0.0
						1.0	    0.0
					</texcoord>				
					<texture video-clip="clips2"/>
					
					<texcoord absolute="false"/>
					<texture static-src="hsvgrad.png"/>
					
					<shader vertexshader="normal2Tex4Video" pixelshader="videowalloverlay">
						<float name="VideoTexCoordScaleX" value="10.0" />
						<float name="VideoTexCoordScaleY" value="10.0" />
						<float name="VideoTexCoordMoveX" value="5.5" />
						<float name="VideoTexCoordMoveY" value="5.5" />
					</shader>	
				</trianglestrip>
				<trianglestrip>
					<transforms>
						<scale y="-1.0"/>
					</transforms>
					<xyz>
						0.0	0.0	0.0
						1.0 0.0	0.0
						0.0	1.0	0.0
						1.0	1.0	0.0
					</xyz>
					
					<texcoord absolute="true">
						1024   	0
						0		0
						1024   	960
						0	    960
					</texcoord>
					<texture static-src="gridder_wall2.png"/>
					
					<texcoord absolute="false">
						0.0   	1.0
						1.0		1.0
						0.0   	0.0
						1.0	    0.0
					</texcoord>				
					<texture video-clip="clips2"/>
					<texcoord absolute="false">
						0.0   	0.3
						1.0		0.3
						0.0   	1.0
						1.0	    1.0						
					</texcoord>
					<texture static-src="mirroralpha.png"/>

					<texcoord absolute="false"/>
					<texture static-src="hsvgrad.png"/>
					
					<shader vertexshader="normal3Tex4Video" pixelshader="videowalloverlay-mirror">
						<float name="VideoTexCoordScaleX" value="10.0" />
						<float name="VideoTexCoordScaleY" value="10.0" />
						<float name="VideoTexCoordMoveX" value="5.5" />
						<float name="VideoTexCoordMoveY" value="5.5" />
					</shader>				
				</trianglestrip>
				
			</container>

			
			<container>
				<transforms>
					<translate x="-3.0" y="0.0" z="6.5"/>
					<rotate-y angle="60.0"/>
					<translate x="-0.5"/>
					<scale x="1.5" y="1.5"/>
				</transforms>
				
				<trianglestrip>
					<xyz>
						0.0	0.0	0.0
						1.0 0.0	0.0
						0.0	1.0	0.0
						1.0	1.0	0.0
					</xyz>
					
					<texcoord absolute="true">
						1024   	0
						0		0
						1024   	960
						0	    960
					</texcoord>
					<texture static-src="gridder_wall3.png"/>
					
					<texcoord absolute="false">
						0.0   	1.0
						1.0		1.0
						0.0   	0.0
						1.0	    0.0
					</texcoord>				
					<texture video-clip="clips3"/>
					<texcoord absolute="false"/>
					<texture static-src="hsvgrad.png"/>
					
					<shader vertexshader="normal2Tex4Video" pixelshader="videowalloverlay">
						<float name="VideoTexCoordScaleX" value="10.0" />
						<float name="VideoTexCoordScaleY" value="10.0" />
						<float name="VideoTexCoordMoveX" value="5.5" />
						<float name="VideoTexCoordMoveY" value="5.5" />
					</shader>				
				</trianglestrip>
				<trianglestrip>
					<transforms>
						<scale y="-1.0"/>
					</transforms>
					<xyz>
						0.0	0.0	0.0
						1.0 0.0	0.0
						0.0	1.0	0.0
						1.0	1.0	0.0
					</xyz>
					
					<texcoord absolute="true">
						1024   	0
						0		0
						1024   	960
						0	    960
					</texcoord>
					<texture static-src="gridder_wall3.png"/>
					
					<texcoord absolute="false">
						0.0   	1.0
						1.0		1.0
						0.0   	0.0
						1.0	    0.0
					</texcoord>				
					<texture video-clip="clips3"/>
					<texcoord absolute="false">
						0.0   	0.0
						1.0		0.0
						0.0   	1.0
						1.0	    1.0						
					</texcoord>
					<texture static-src="mirroralpha.png"/>

					<texcoord absolute="false"/>
					<texture static-src="hsvgrad.png"/>
					
					<shader vertexshader="normal3Tex4Video" pixelshader="videowalloverlay-mirror">
						<float name="VideoTexCoordScaleX" value="10.0" />
						<float name="VideoTexCoordScaleY" value="10.0" />
						<float name="VideoTexCoordMoveX" value="5.5" />
						<float name="VideoTexCoordMoveY" value="5.5" />
					</shader>				
				</trianglestrip>				
			</container>
			
			<container>
				<transforms>
					<translate x="2.5" y="0.0" z="6.5"/>
					<rotate-y angle="-60.0"/>
					<translate x="-0.5"/>
					<scale x="1.5" y="1.5"/>
				</transforms>
			
				<trianglestrip>
					<xyz>
						0.0	0.0	0.0
						1.0 0.0	0.0
						0.0	1.0	0.0
						1.0	1.0	0.0
					</xyz>
					
					<texcoord absolute="true">
						1024   	0
						0		0
						1024   	960
						0	    960
					</texcoord>
					<texture static-src="gridder_wall4.png"/>
					
					<texcoord absolute="false">
						0.0   	1.0
						1.0		1.0
						0.0   	0.0
						1.0	    0.0
					</texcoord>				
					<texture video-clip="clips4"/>
					
					<texcoord absolute="false"/>
					<texture static-src="hsvgrad.png"/>
					<shader vertexshader="normal2Tex4Video" pixelshader="videowalloverlay">
						<float name="VideoTexCoordScaleX" value="10.0" />
						<float name="VideoTexCoordScaleY" value="10.0" />
						<float name="VideoTexCoordMoveX" value="5.5" />
						<float name="VideoTexCoordMoveY" value="5.5" />
					</shader>				
				</trianglestrip>
				<trianglestrip>
					<transforms>
						<scale y="-1.0"/>
					</transforms>
					<xyz>
						0.0	0.0	0.0
						1.0 0.0	0.0
						0.0	1.0	0.0
						1.0	1.0	0.0
					</xyz>
					
					<texcoord absolute="true">
						1024   	0
						0		0
						1024   	960
						0	    960
					</texcoord>
					<texture static-src="gridder_wall4.png"/>
					
					<texcoord absolute="false">
						0.0   	1.0
						1.0		1.0
						0.0   	0.0
						1.0	    0.0
					</texcoord>				
					<texture video-clip="clips4"/>
					<texcoord absolute="false">
						0.0   	0.0
						1.0		0.0
						0.0   	1.0
						1.0	    1.0						
					</texcoord>
					<texture static-src="mirroralpha.png"/>

					<texcoord absolute="false"/>
					<texture static-src="hsvgrad.png"/>
					
					<shader vertexshader="normal3Tex4Video" pixelshader="videowalloverlay-mirror">
						<float name="VideoTexCoordScaleX" value="10.0" />
						<float name="VideoTexCoordScaleY" value="10.0" />
						<float name="VideoTexCoordMoveX" value="5.5" />
						<float name="VideoTexCoordMoveY" value="5.5" />
					</shader>				
				</trianglestrip>					
			</container>
			
			<container>
				<transforms>
					<!--scale x="0.75" z="0.75"/-->
					<translate z="9.00"/>
				</transforms>
				
				
				<!-- First we draw all the mirrored videos ... -->
				<container>
					<transforms>
						<translate x="-1.2"/>
					</transforms>
					
					<trianglestrip>
						<xyz>
							-0.5	0.0	0.0
							0.5		0.0	0.0
							-0.5	1.0	0.0
							0.5		1.0	0.0
						</xyz>
						<texcoord absolute="false">
							0.0   	1.0
							1.0		1.0
							0.0   	0.0
							1.0	    0.0
						</texcoord>	
						<texture video-clip="clips1"/>

						<texcoord absolute="false">
							0.0   	0.3
							1.0		0.3
							0.0   	1.0
							1.0	    1.0						
						</texcoord>
						<texture static-src="mirroralpha.png"/>	

						<transforms>
							<translate x="0.0" y="0.0" z="0.5"/>
							<scale y="-1.0"/>
						</transforms>
						<shader vertexshader="roty-mirror" pixelshader="transparent-mirror">
							<float name="alphamul" value="0.75"/>
							<float name="timeMultiply" value="1.25"/>
							<float name="scale" value="0.75"/>
						</shader>
					</trianglestrip>
				</container>
				
				<container>
					<transforms>
						<translate x="0"/>
					</transforms>
					
					<trianglestrip>
						<xyz>
							-0.5	0.0	0.0
							0.5		0.0	0.0
							-0.5	1.0	0.0
							0.5		1.0	0.0
						</xyz>
						<texcoord absolute="false">
							0.0   	1.0
							1.0		1.0
							0.0   	0.0
							1.0	    0.0
						</texcoord>	
						<texture video-clip="clips2"/>

						<texcoord absolute="false">
							0.0   	0.2
							1.0		0.2
							0.0   	1.0
							1.0	    1.0						
						</texcoord>
						<texture static-src="mirroralpha.png"/>	

						<transforms>
							<translate x="0.0" y="0.0" z="0.5"/>
							<scale y="-1.0"/>
						</transforms>
						<shader vertexshader="roty-mirror" pixelshader="transparent-mirror">
							<float name="alphamul" value="0.75"/>
							<float name="timeMultiply" value="1.25"/>
							<float name="scale" value="0.75"/>
						</shader>
					</trianglestrip>
				</container>				

				<container>
					<transforms>
						<translate x="1.2"/>
					</transforms>
					
					<trianglestrip>
						<xyz>
							-0.5	0.0	0.0
							0.5		0.0	0.0
							-0.5	1.0	0.0
							0.5		1.0	0.0
						</xyz>
						<texcoord absolute="false">
							0.0   	1.0
							1.0		1.0
							0.0   	0.0
							1.0	    0.0
						</texcoord>	
						<texture video-clip="clips3"/>

						<texcoord absolute="false">
							0.0   	0.3
							1.0		0.3
							0.0   	1.0
							1.0	    1.0						
						</texcoord>
						<texture static-src="mirroralpha.png"/>	

						<transforms>
							<translate x="0.0" y="0.0" z="0.5"/>
							<scale y="-1.0"/>
						</transforms>
						<shader vertexshader="roty-mirror" pixelshader="transparent-mirror">
							<float name="alphamul" value="0.75"/>
							<float name="timeMultiply" value="1.25"/>
							<float name="scale" value="0.75"/>
						</shader>
					</trianglestrip>
				</container>
				
				<!-- Now comes da glow -->
				
				<array count="3">
					<transforms>
						<translate x="-1.2"/>
					</transforms>
					
					<step-transforms>
						<translate x="1.2"/>
					</step-transforms>
					
					<trianglestrip>
						<xyz>
							0.0	0.0	0.0
							1.0 0.0	0.0
							0.0	0.0	1.0
							1.0	0.0	1.0
						</xyz>
						<texcoord absolute="false">
							1.0   	0
							0		0
							1.0   	1.0
							0	    1.0
						</texcoord>
						
						<texture static-src="glow.png"/>

						<shader vertexshader="id" pixelshader="glowintens">
						</shader>						
						
						<transforms>
							<translate x="0.0" y="0.0" z="0"/>
							<translate x="-0.5"/>
						</transforms>
					</trianglestrip>
				</array>
				
				<!-- No we draw on top the videos -->
			
				<container>
					<transforms>
						<translate x="-1.2"/>
					</transforms>
					<trianglestrip>
						<xyz>
							-0.5	0.0	0.0
							0.5		0.0	0.0
							-0.5	1.0	0.0
							0.5		1.0	0.0
						</xyz>
						<texcoord absolute="false">
							0.0   	1.0
							1.0		1.0
							0.0   	0.0
							1.0	    0.0
						</texcoord>
						
						<texture video-clip="clips1"/>
						<transforms>
							<translate x="0.0" y="0.0" z="0.5"/>
						</transforms>
						<shader vertexshader="roty" pixelshader="transparent">
							<float name="alphamul" value="0.75"/>
							<float name="timeMultiply" value="1.25"/>
							<float name="scale" value="0.75"/>
						</shader>
					</trianglestrip>
				</container>
				
				<container>
					<transforms>
						<translate x="0.0"/>
					</transforms>
					<trianglestrip>
						<xyz>
							-0.5	0.0	0.0
							0.5		0.0	0.0
							-0.5	1.0	0.0
							0.5		1.0	0.0
						</xyz>
						<texcoord absolute="false">
							0.0   	1.0
							1.0		1.0
							0.0   	0.0
							1.0	    0.0
						</texcoord>
						
						<texture video-clip="clips2"/>
						<transforms>
							<translate x="0.0" y="0.0" z="0.5"/>
						</transforms>
						<shader vertexshader="roty" pixelshader="transparent">
							<float name="alphamul" value="0.75"/>
							<float name="timeMultiply" value="1.25"/>
							<float name="scale" value="0.75"/>
						</shader>
					</trianglestrip>
				</container>
				<container>
					<transforms>
						<translate x="1.2"/>
					</transforms>				
					<trianglestrip>
						<xyz>
							-0.5	0.0	0.0
							0.5		0.0	0.0
							-0.5	1.0	0.0
							0.5		1.0	0.0
						</xyz>
						<texcoord absolute="false">
							0.0   	1.0
							1.0		1.0
							0.0   	0.0
							1.0	    0.0
						</texcoord>
						
						<texture video-clip="clips3"/>
						<transforms>
							<translate x="0.0" y="0.0" z="0.5"/>
						</transforms>
						<shader vertexshader="roty" pixelshader="transparent">
							<float name="alphamul" value="0.75"/>
							<float name="timeMultiply" value="1.25"/>
							<float name="scale" value="0.75"/>
						</shader>
					</trianglestrip>
				</container>				
			</container>
		</container>
	</world>

  </worlds>
  <initial-render-instructions>
    <render-to clear-color="#00FFFFFF" texture="textshadow" viewport="textshadow"/>
    <render-to clear-color="#00FFFFFF" texture="text" viewport="text"/>
  </initial-render-instructions>
  <render-instructions>
    <render-to clear-depth="1" clear-color="#FF000000" texture="videowalls" viewport="background" />
    <render-to texture="videowalls" viewport="videowalls" />
    <render-to clear-depth="1" clear-color="#FF000000" buffer="back" viewport="menu"/>
    <render-to buffer="back" viewport="helperoverlay" />
  </render-instructions>
</m3danim>




