didnt help ... i ran a test where i try to add more planes in the
background, but sometimes they show in the front, sometimes in the
back ... i don“t see any consistancy there :/

(click to add more planes)
http://www.swfcabin.com/open/1292845152

this is the code:

package {
        import away3d.cameras.Camera3D;
        import away3d.cameras.HoverCamera3D;
        import away3d.containers.ObjectContainer3D;
        import away3d.core.base.Object3D;
        import away3d.events.MouseEvent3D;
        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageQuality;
        import flash.display.StageScaleMode;
        import flash.events.Event;
        import flash.events.MouseEvent;

        import away3d.containers.View3D;
        import away3d.core.base.Mesh;
        import away3d.primitives.Cube;
        import away3d.primitives.Plane;
        import away3d.materials.WireColorMaterial;
        import away3d.materials.ColorMaterial;




        public class ZTest extends Sprite {

                private var view:View3D;
                private var plane:Plane;
                private var cont:ObjectContainer3D;
                private var count:int = 1;


                public function ZTest() {
                        stage.quality = StageQuality.HIGH;
                        stage.scaleMode = StageScaleMode.NO_SCALE;
                        stage.align = StageAlign.TOP_LEFT;
                        addEventListener(Event.ADDED_TO_STAGE, init);
                }




                public function init(e:Event ):void {
                        removeEventListener(Event.ADDED_TO_STAGE, init);
                        view = new View3D();
                        view.x = stage.stageWidth / 2;
                        view.y = stage.stageHeight / 2;
                        addChild(view);


                        cont = new ObjectContainer3D();
                        view.scene.addChild(cont);
                        addPlane(null);

                        addEventListener(Event.ENTER_FRAME, render);
                        stage.addEventListener(MouseEvent.CLICK, addPlane);

                }


                private function addPlane(e:Event):void {
                        var pl:Plane = new Plane({ width:20+(count*10), 
height:100,
segmentsW:24, segmentsH:10 } );
                        pl.material = new ColorMaterial(int(Math.random()* 
0xFFFFFF));
                        pl.rotationX =  90;
                        pl.ownCanvas = true
                        pl.pushback = true;
                        cont.addChild(pl);
                        pl.screenZOffset = 10 * count;
                        count ++;
                }




                private function render(event:Event):void {
                        view.render();
                }
        }
}

Reply via email to