I have the same problem, and I create this bug emulation but I still
waiting for a resolution:

http://developersuniverse.com/away3d/BugReproducer.zip

In this files, the problem comes when some objects leaves the range of
view of the camera. If any person doesnt trust on my my zip file,
I post the code below:

Away3dApplication.as (for all my away3d
applications)---------------------------------------------------------------------------------------

package
{
        import away3d.cameras.Camera3D;
        import away3d.containers.ObjectContainer3D;
        import away3d.containers.Scene3D;
        import away3d.containers.View3D;
        import away3d.core.render.Renderer;


        import flash.display.Sprite;
        import flash.events.Event;

        public class Away3dApplication extends Sprite
        {
                protected var  _scene:Scene3D;
                protected var _camera:Camera3D;
                protected var _view:View3D;
                protected var _container:ObjectContainer3D;
                public function Away3dApplication(){
                        initEngine();
                        initListeners();
                }
                public function resetCamera ():void{
                        //_camera.y = 0;
                        _camera.x = 0;
                        _camera.z = 0;
                        //_camera.lookAt(_container.position);

                }
                protected function initEngine():void{
                        _scene = new Scene3D();
                        _camera = new Camera3D({zoom:10, focus:50, x:0, y:-500, 
z:-250});
                        _view = new View3D({scene:_scene, camera:_camera,
renderer:Renderer.INTERSECTING_OBJECTS});
                        _view.x = 400;
                        _view.y = 300;
                        addChild( _view );
                        _container = new ObjectContainer3D ();
                        _scene.addChild( _container );
                        _camera.lookAt( _container.position);
                }
                /**
                 * Initialise the listeners
                 */
                protected function initListeners():void{
                        addEventListener( Event.ENTER_FRAME, onEnterFrame );
                }
                /**
                 * Render loop
                 */
                protected function onEnterFrame( $event:Event ):void{
                        _view.render();
                }
        }
}

on BugReproducer.as file
-------------------------------------------------------------------------------------------------------------------
package
{

        import away3d.core.utils.Cast;
        import away3d.materials.BitmapMaterial;
        import away3d.primitives.Cube;
        import away3d.primitives.Plane;

        import flash.display.Sprite;
        import flash.events.Event;

        public class BugReproducer extends Away3dApplication{
                //use any jpg, who cares!!
                               [Embed(source="brick.jpg")]
                private var _brick:Class

                public function BugReproducer(){
                        initObjects ();
                }
                public function initObjects ():void{
                        var material:BitmapMaterial = new
BitmapMaterial( Cast.bitmap(_brick) );
                        var plane:Plane = new Plane({material: material, 
width:1000, height:
500, segmentsW:4, segmentsH:4, yUp:false});
                        _container.addChild(plane);
                        for (var i:int =1 ; i< 10; i++){
                                var newCube:Cube = getTestCube(material);
                                _container.addChild(newCube);
                        }

                        _camera.y = -1000;

                }
                protected function getTestCube($material:BitmapMaterial):Cube{
                        var newcube:Cube = new Cube({material: $material, 
width:50, height:
50});
                        newcube.rotationX = 90;
                        newcube.x = randomRange(-300, 300);
                        newcube.z = -200
                        newcube.y = randomRange(-150, 100);
                        return newcube;
                }
                protected function randomRange ($min:Number, 
$max:Number):Number{
                        var randomNum:Number = Math.floor(Math.random() * ($max 
- $min +
1)) + $min;
                return randomNum;
                }
                protected override function onEnterFrame($event:Event):void{
                        _container.x +=10;
                        super.onEnterFrame($event);
                }
        }
}
------------------------------------------



Just create one instance of BugReproducer, and add it to display
list:


var bugEmulator:BugReproducer = new BugReproducer ();
addChild(bugEmulator);




Reply via email to