Hello Thadeu,

I haven't used the AWData parser, but I'm pretty sure that all works
in a similar way. This is the way how I load external objects into my
scene, still I prefer to embed the models instead of load them when
they are not too many or too heavy. I wrote this example for your
specific case. Let me know if it works cause I didn't run it or test
it, or if I can help you better.

private var _AWData:AWData;
private var loader:Loader3D;

private var model:ObjectContainer3D;
private var models:Array = [];

private function init():void
{

        for(var i:int = 1; i<7; i++){
                var _materials:Array = [/*...list of materials here, in this
case embedded bitmaps...*/];

                var _modelsMaterial:BitmapMaterial = new
BitmapMaterial(Cast.bitmap(_materials[i]));

                _AWData = new AWData();
                _AWData.centerMeshes=true;
                _AWData.material = _modelsMaterial;

                model = new ObjectContainer3D();

                loader = new Loader3D();
                loader.addEventListener(Loader3DEvent.LOAD_SUCCESS, 
loadSuccess);
                
loader.loadGeometry("../resources/Element"+i+"/Element"+i+".awd",
_AWData);
                model.addChild(loader);
                model.x = i*model.objectWidth+10;//no idea the size of the
models...this is to separete them from the defoult position 0,0,0
                models.push(model);
                scene.addChild(model);
        }
}

private function loadSuccess(e:Loader3DEvent):void{
        var _model:ObjectContainer3D = loader.handle as ObjectContainer3D;
        model.addChild(_model);
}

Best,

Ivan Moreno
http://www.thefloatingwall.com/

On Aug 10, 4:49 pm, Thadeu Henrique <[email protected]> wrote:
> Any help?
>
> Thadeu Henrique
>
> On Tue, Aug 9, 2011 at 12:59 PM, Thadeu Henrique
> <[email protected]>wrote:
>
>
>
>
>
>
>
> > Hi, folks.
>
> > Why when multiple objects are loaded the material is not applied?
> > Exemple(loading six objects exported from preFab3D):
>
> > var obj1:Object3D = AWData.load("../resources/Element1/Element1.awd",
> > {rotationX: 90});
> > var obj2:Object3D = AWData.load("../resources/Element2/Element2.awd",
> > {rotationX: 90});
> > var obj3:Object3D = AWData.load("../resources/Element3/Element3.awd",
> > {rotationX: 90});
> > var obj4:Object3D = AWData.load("../resources/Element4/Element4.awd",
> > {rotationX: 90});
> > var obj5:Object3D = AWData.load("../resources/Element5/Element5.awd",
> > {rotationX: 90});
> > var obj6:Object3D = AWData.load("../resources/Element6/Element6.awd",
> > {rotationX: 90});
>
> > Only the last object is loaded correctly, with material applied.
> > Exist a best way to do this?
> > Any suggestion?
>
> > I am using Away 3.6.
>
> >  Thadeu Henrique

Reply via email to