Almost immediately my first hurdle was trying to figure out how to manipulate material on planes. By default the material fills the entire plane no matter what, but I wanted to use 1 material on multiple planes and have each plane show a different section of the material. I could easily cut up a bitmap and use that, however the project called for a Video so that option was clearly out. Basically I needed a function to scale and offset the material.
After digging through the API and scouring the Forum I eventually found out that each plane is made up of 2 faces. Each face is a triangle and has 3 vertexes and 3 uv values. By looping through both faces and each vertex and changing their uv values one by one I was able to scale/offset the entire plane's uv.
The following code snippet shows the general idea:
var geo:GeometryObject3D = plane.geometry;
var face:Triangle3D = geo.faces;
var left:Number = .5;
var right:Number = 1;
var top:Number = 1;
var bottom:Number = .5;
var topLeft:NumberUV = new NumberUV(left,top);
var topRight:NumberUV = new NumberUV(right,top);
var bottomLeft:NumberUV = new NumberUV(left,bottom);
var bottomRight:NumberUV = new NumberUV(right,bottom);
var numberUV:NumberUV = face.uv0;
numberUV.u = bottomLeft.u;
numberUV.v = bottomLeft.v;
After this point you would continue to alter the other 2 uv values on the face (uv1, uv2) and then do the same for the remaining face.
UV values range from 0 to 1 (when the material is not tiled, it can be greater when tiled). By default the left value should be 0, the right value would be 1. By changing both the left and the bottom to .5 we should only see the top right corner of the material on the plane. Everything on the left half and bottom half would be cropped.
Let me know if you have an easier way to achieve the same effect. Would love to hear it.
I will post the project once it is complete.