Mapping Video Onto Avalon 3D Mesh Objects -- Sandbox3D V.0.0.0.2
With this release of Sandbox3D, I have added the ability to map video onto 3D meshes and then manipulate the mesh while the video plays (which can make for some very bizarre experiences...). Below is the good old torus, aka donut, with the Windows System .wmv playing on it.
By default, the file open dialog will point to this directory, so that you can very quickly see this working even if you don't have a .wmv handy. Of course, you can open any video on your system and load it onto a mesh with Sandbox3D. The key part of the code is as follows:
private void DrawVideoOnMesh(VideoDrawing vd, GeometryModel3D gm3d, Uri uri)
MediaTimeline mt = new MediaTimeline(uri);
MediaClock mc = mt.CreateClock();
vd.MediaClock = mc;
vd.Rect = new Rect(0, 0, 400, 400);
DrawingBrush db = new DrawingBrush();
db.Drawing = vd;
Brush br = db as Brush;
MaterialGroup mg = new MaterialGroup();
mg.Children.Add(new SpecularMaterial(Brushes.White, 40));
gm3d.Material = mg;
Props to RHogue for the code snippet; word on the street is that he'll prop some more video on 3D demos shortly.