Molehill VideoMaterial

Software: Away3D 4.x

zen, Newbie
Posted: 11 March 2012 09:48 PM   Total Posts: 2

Hi, been using an alpha release from git since November and I’d like to know how to use the VideoMaterial.

I currently have my assets in a database and have used a mixture of the official examples and forum threads from people such as yourselves to get models and materials as desired. To finish my project, I’d like to display a video (mp4/mov) upon a primitive plane but can’t find any molehill examples.

Could someone please point me to an example or guide me through it?

Additionally, with images I create a sprite, add a background, scale my image to fit, add that and any transparencies and return its bitmapdata for use as a texture. Could similar be done with video for either a custom background/overlay?

Thanks in advance.

   

John Brookes, Moderator
Posted: 11 March 2012 11:37 PM   Total Posts: 732   [ # 1 ]

The basics

var vt:VideoTexture= new VideoTexture(“new_york.flv”,512,512)
var tm:TextureMaterial = new TextureMaterial(vt);
var planeGeom:PlaneGeometry = new PlaneGeometry(1024, 512, 1, 1, false);//same ratio as flv
var planeMesh:Mesh = new Mesh(planeGeom, tm);
scene.addChild(planeMesh);

vt.player.play();

   

zen, Newbie
Posted: 12 March 2012 12:45 AM   Total Posts: 2   [ # 2 ]

Thank you for the reply.

The new texture stuff isn’t in this alpha, so used the beta to test (lots of stuff for me to fix if this works). I get, ” Loaded file is an unknown type” whether I use a local flv as in your example or an mp4 out of my database.

Any ideas? Are there any encoding restrictions?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X