In version 3.0, the Web Driver allows you to play an AVI movie.
To use a movie you apply it as a surface shader procedural. You can then apply
the surface shader to 3D geometry or attach it to an empty WTGroup
to be used as a sprite or decal. It can even be set as a texture for a spout!
In the scene above, a small movie is being used as the texture on the
deforming flag model. You can turn it by dragging the mouse.
Notice that because the movie acts as the texture for a surface shader layer,
you can make use of the scene's lighting with the movie playing on 3D objects.
The copy of the movie
that you see playing in the background is attached to a WTGroup and is
only there for reference. You can't use an AVI for a WTDrop because
drops can't be created from a surface shader.
The AVI functionality is controlled through a WTSurfaceShader's procedural
property. All movie controls, including loading the movie,
are accessed through the command string of the
setProceduralWithString API:
Because of the large amount of system resources necessary for using the Web Driver
AVI feature, it is not designed to act as a robust movie player.
It is designed to simply be a technique for storing multiple frames of
low-resolution animation. If you design with this philosophy in mind, you will
have the best chance of avoiding performance issues.
To find out if your movie file is loaded, call isLoadedWithChildren or
setOnLoadedWithChildren on the WTSurfaceShader object. The AVI
file is considered a child of the surface shader.
One of the things you can do to improve performance of your movie is
to set the mip count of the surface shader to 1 using the
setTextureNumMipMapLevels method. This prevents the Web Driver
from internally creating various detail levels of your bitmap.
These calculations are hard enough for a static bitmap, so you may want to
also avoid it when using movies. In most cases you don't have to worry,
because the default number of mips is 1 anyway.
"AVI stop" is an important function to know, because it clears the movie
from memory. AVI files are notorious for memory usage.
Web Driver AVI's do not play audio.
The Web Driver does not have the capability to stream the AVI.
Surface shader layers that use an AVI will not honor alpha or color keys.
Keep in mind that you must pick a common AVI codec when saving your movies
or else your user will not be able to see the video.
This movie was made using 3ds max. Adobe Premiere is an excellent
package for creating and saving movies. For the developer on a tight budget,
there are plenty
of free programs out there that let you turn a series of bitmaps into a movie.
Avi Creator (from
Bloodshed Software)
is a pretty good one.