ADVANCED SPOTTING > STRETCHING STREAMING VIDEO IN 3DML

You can also take a single video stream and stretch it across several blocks to give yourself a larger video screen. (It is important to remember though that stretching the video to be larger than it was originally intended will degrade the quality of the image, just like it does for textures.) This is accomplished by specifying exactly what part of the video image to place on each block. Here's the syntax for the CREATE tags for part of a video on a full block:

<CREATE SYMBOL="#" BLOCK="full">
<PART NAME="part_name" STREAM="stream_name" RECT="x1,y1,x2,y2"/>
</CREATE>

x1,y1 refers to the top left corner of the rectangle, and x2,y2 refers to the bottom right corner.

Texture Coordinates for Stretching Video

The values for x and y can be expressed either as a specific number of pixels or as a percentage of the total width/height of the video. For example: Lets say you want to stretch a video that is 160x120 across 2 full blocks sitting side by side. The CREATE tags for those blocks could either look like this:

<CREATE SYMBOL="1" BLOCK="full">
<PART NAME="part_name" STREAM="stream_name" RECT="0,0,80,120"/>
</CREATE>

<CREATE SYMBOL="2" BLOCK="full">
<PART NAME="part_name" STREAM="stream_name" RECT="80,0,160,120"/>
</CREATE>

OR, they could look like this:

<CREATE SYMBOL="1" BLOCK="full">
<PART NAME="part_name" STREAM="stream_name" RECT="0%,0%,50%,100%"/>
</CREATE>

<CREATE SYMBOL="2" BLOCK="full">
<PART NAME="part_name" STREAM="stream_name" RECT="50%,0%,100%,100%"/>
</CREATE>

Now lets look at an example that stretches the Bug's Life video across a video wall that is 2 blocks high and 3 blocks wide. We'll also keep a LARGETV block on either side of the wall to compare the quality of the smaller video with the one that is enlarged. Look at the diagram below to understand how the video is broken up onto the 6 different blocks.

Texture Coordinates for Stretching Video


<SPOT>

<HEAD>

<TITLE NAME="Video in 3DML" />
<BLOCKSET HREF="http://blocksets.flatland.com/flatsets/basic.bset"/>
<BLOCKSET HREF="http://blocksets.flatland.com/flatsets/interior.bset"/>
<MAP DIMENSIONS="(5,5,2)" STYLE="single"/>
<SKY />
<GROUND />
<STREAM NAME="bugslife" WMP="http://www.hollywood.com/trailers/bugslife/low_bugslife.asx" RP="http://www.hollywood.com/trailers/bugslife/low_bugslife.asx"/>

</HEAD>

<BODY>

<CREATE SYMBOL="n" BLOCK="largetv">
<PART NAME="screen" STREAM="bugslife"/>
</CREATE>

<CREATE SYMBOL="1" BLOCK="full">
<PART NAME="s" STREAM="bugslife" RECT="0%,0%,33.3%,50%"/>
</CREATE>

<CREATE SYMBOL="2" BLOCK="full">
<PART NAME="s" STREAM="bugslife" RECT="33.3%,0%,66.6%,50%"/>
</CREATE>

<CREATE SYMBOL="3" BLOCK="full">
<PART NAME="s" STREAM="bugslife" RECT="66.6%,0%,100%,50%"/>
</CREATE>

<CREATE SYMBOL="4" BLOCK="full">
<PART NAME="s" STREAM="bugslife" RECT="0%,50%,33.3%,100%"/>
</CREATE>

<CREATE SYMBOL="5" BLOCK="full">
<PART NAME="s" STREAM="bugslife" RECT="33.3%,50%,66.6%,100%"/>
</CREATE>

<CREATE SYMBOL="6" BLOCK="full">
<PART NAME="s" STREAM="bugslife" RECT="66.6%,50%,100%,100%"/>
</CREATE>

<LEVEL NUMBER="1">
n456n
.....
.....
</LEVEL>

<LEVEL NUMBER="2">
.123.
.....
.....
</LEVEL>

<ENTRANCE NAME="default" LOCATION="(3,5,1)" />

</BODY>

</SPOT>

spot


Notice the difference in the quality of the video when it is blown up to the larger size. Just like with gif and jpeg images, stretching a video to fill a larger space will cause pixelization.

Streaming Sounds
You can also use streaming media to provide the ambient sound in your spot. If you define an audio-only stream in the STREAM tag, then Rover will play that sound back as if it were the ambient sound. You do not need to call the stream out anywhere in the body of the file. Just include the audio-only stream in the STREAM tag in the HEAD.




Copyright 1999, 2000 Flatland Online, Inc.