Is it possible to set a layer for a collada model (or 3ds model)?

If I set layer for many Plane objects (like in the ExLayer example), it
works fine, but when I try do combine Plane (ground - always on the bottom
layer) and a collada model, then the model is always covered by the plane.

I tried both FastRenderer and BasicRenderer, with the same results.

My code:

/* setting plane layer */

groundLayer = new Sprite();
 view.addChild(groundLayer);
 view.setChildIndex(groundLayer, 0);

groundPlane.layer = groundLayer;



/* init model loading */
collada = new Collada();
collada.scaling = 175;


loader = new Loader3D();
loader.loadGeometry("assets/model.dae", collada);
loader.addEventListener(Loader3DEvent.LOAD_SUCCESS, onColladaLoadSuccess);

scene.addChild(loader);

-----

/* onColladaLoadSuccess - dae load handler */


model = loader.handle as ObjectContainer3D;
var layer:Sprite = new Sprite();
view.addChild(layer);
model.layer = layer;


Thanks,
Piotr

Reply via email to