Hi there, trying to achieve this:
private function blockComplete(event : Loader3DEvent) : void
{
trace ("DAE loaded");
//blockContainer = new Plane();
blockContainer = event.loader.handle as ObjectContainer3D;
blockContainer.scale(100);
view.scene.addChild(blockContainer);
view.camera.z = -1000;
var mesh : ObjectContainer3D;
for (var i : int = 0; i < blockContainer.numChildren; ++i)
{
mesh = ObjectContainer3D(blockContainer.getChildAt(i));
//var blockMaterials : ColorMaterial = new ColorMaterial(0xff0000);
var blockMaterials:ShadingColorMaterial = new ShadingColorMaterial(0xFFFFFF, { diffuse:0xFFFFFF, specular:0xFFFFFF, alpha:1 } );
mesh.material = blockMaterials;
}
}
Which is partially ported back from away3d V4 - seems like the getChildAt method is not there in 3.6 - how ddo I cycle through and change all the meterials? Or maybe a different method to load the .dae with alternative materials from the start (once object is loaded, materials stay the same, but the material color is specified using flashVars..
here’s the .dae load function:
private function loadBlock() : void
{
blockLoader = Collada.load(flashvars.obj);
blockLoader.addEventListener(Loader3DEvent.LOAD_SUCCESS,blockComplete);
}