[Papervision3D] clash of parsers?
John McCormack
john at easypeasy.co.uk
Thu Apr 1 09:06:14 PDT 2010
John,
Your code is about the same as mine (exported from Swift3D).
Repeat this
mColladaG = new DAE();
mColladaG.addEventListener(FileLoadEvent.LOAD_COMPLETE, onFileLoaded,
false, 0, true);
mColladaG.load("assets\\Gamma.dae",null,true);
mRootNodeG = mScene.addChild( mColladaG, "mRootNode" );
for mColladaA, mColladaB, mColladaG and mColladaR
loading from: Alpha.dae, Beta.dae, Gamma.dae and Radiator.dae.
Inside onFileLoaded(), the material list is traversed and materials set
to double sided - that's all.
Maybe they shouldn't be added to the scene until after loading is
complete but that's the code supplied and it works fine if I use
mColladaG.load("assets\\Gamma.dae",null,true);
Without the "null,true" it's no go.
It is just possible that because these four items were separately
exported from a single project that they have some cross-linked references.
It seems unlikely since in each dae only one item: Alpha, Gamma, Beta or
Radiator is mentioned.
I will go back and create separate files to export from.
Thank you.
John
John Brookes wrote:
> Assuming your loading the same dae file. Something like
>
>
> for (var i:int = 0; i < 3; i++)
> {
> daeModel = new DAE();
> daeModel.load("../src/model.dae");
> daeModel.addEventListener(FileLoadEvent.LOAD_COMPLETE ,
> daeLoadCompleteHandler);
> }
> }
>
> private function daeLoadCompleteHandler(e:FileLoadEvent):void
> {
> e.target.name <http://e.target.name> = "daeModel"+numLoaded
> e.target.x =numLoaded* 100;
> scene.addChild(DAE(e.target));
> trace(e.target.name <http://e.target.name>)
>
>
> if (numLoaded == 2)
> {
> scene.getChildByName("daeModel2").scale = 3;
> }
>
> numLoaded++
>
> ...
> ------------------------------------------------------------------------
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
More information about the Papervision3D
mailing list