Glad to hear you're making progress, although if I were you I'd pay a lot more attention to Fabrice than me!
A possible source of your material problem is its name in the dae file. I know I've had problems with names containg hyphens before. Try doing a find and replace in your dae file so that all instances of: i01_-_Default become: i01_Default Regards, John Wilson On Sep 14, 2:53 pm, bebensiganteng <[email protected]> wrote: > thanks Fabrice but i've tried John's solution and it worked! > > aaand one more question ;) > > var bitmap:Bitmap = new CrateMat(); > var crateMat:BitmapMaterial = new BitmapMaterial(bitmap.bitmapData); > > var collada:Collada = new Collada(); > var m:ObjectContainer3D = collada.parseGeometry(CrateMesh) as > ObjectContainer3D; > > m.materialLibrary.getMaterial("i01_-_Default").material = crateMat; > > assigning the material doesnt seem to work, am i missing something? or > is it something that i need to do in the collada? > > On Sep 14, 1:35 pm, John Wilson <[email protected]> > wrote: > > > > > Hi, > > > I found that I could add a collada model to a BSP tree by adding the > > first child of the ObjectContainer3D containing the mesh to the tree. > > In your case that might mean you have to use something like: > > _tree.addChild(_loader3d.children[0]); > > > I have only tried doing it with embedded collada files. I put an > > example in the guide you can see at:http://john-wilson.110mb.com/ > > > Select "In the city" at the top left, the select the "description of > > the process" option. Example code for adding a collada model is on > > page 3 - try positioning your model close the the initial camera > > position. In my example, if you look around as soon as the BSP loads, > > you will see a street light that is an embedded collada. > > > Hope this helps. > > > Regards, > > > John Wilson > > > On Sep 14, 10:11 am, bebensiganteng <[email protected]> wrote: > > > > hi guys, > > > > is there something wrong with my code? > > > > _collada = new Collada(); > > > _collada.centerMeshes = true; > > > > _loader3d = Collada.load("crate.dae" ); > > > > _loader3d.addOnSuccess(onLoaderSuccess); > > > _tree.addChild(_loader3d); > > > > private function onLoaderSuccess(e:Loader3DEvent):void > > > { > > > var target:Object3D = ObjectContainer3D(e.loader.handle); > > > target.scale(30); > > > trace(target); > > > > } > > > > although i can trace target but i cant seems to see it, or is this not > > > the correct way to add collada to the BSP tree?- Hide quoted text - > > - Show quoted text -
