Hello,

I'm quite new to Away3D and i'm testing a few stuff for a future
project.
Before, i used a little papervision3D but this time my client want me
to work with away3D
I made a 3D model with blender (quite simple because 3D is not really
my friend ^-^) and I load its in flash.
Unitl this, no problem.

But when rendering in flash, the result is a little bit uggly as you
can see here (the first image is blender model and the other four
the .swf) :
http://beta.loiseleur.org/away3D/

I don't really konw why but the wheels, the body and the ground are
mixing together.
I try to find a solution on the net (and in class documentation) with
no results...

Here is the code if necessary (maybe i made a mistake) :

public class Trial extends MovieClip {

                /////////////
                // PROPERTIES
                private var _scene3D     :Scene3D;
                private var _camera3D    :Camera3D;
                private var _view3D      :View3D;
                private var _container3D :ObjectContainer3D;
                private var _collada     :Collada;
                private var _loader      :Loader3D;
                private var _model       :Object3D;
                /////////////

                /////////////
                //// METHODES

                ///////////// Loader3DEvent.LOAD_SUCCESS
                private function onDAESuccess( 
p_eventObject:Loader3DEvent):void {

                        // shortcut to collada 3D object
                        _model = _loader.handle;

                        // update car material
                        var wcm:WireColorMaterial = new WireColorMaterial( 
0xFF6666,
{ wirecolor:0xFF8888 } )
                        
_model.materialLibrary.getMaterial('car_png_001').material = wcm;
                }

                ///////////// Event.ENTER_FRAME
                private function onRender( p_eventObject:Event ):void {
                        /*
                        _container3D.yaw  ( 5 );
                        _container3D.roll ( 5 );
                        _container3D.pitch( 5 );
                        */

                        // render 3D scene
                        _view3D.render();
                }

                /////////////
                private function createScene():void {

                        // create an object container to group the objects on 
the scene
                        _container3D = new ObjectContainer3D();
                        _scene3D.addChild( _container3D );

                        // collada
                        _collada              = new Collada();
                        _collada.scaling      = 400;
                        _collada.centerMeshes = true;

                        _loader               = new Loader3D();
                        _loader.loadGeometry( "car.dae", _collada );
                        _loader.addEventListener( Loader3DEvent.LOAD_SUCCESS,
onDAESuccess );
                        _container3D.addChild( _loader );
                }

                /////////////
                private function init3D():void {

                        // create a new scene where all the 3D object will be 
rendered
                        _scene3D = new Scene3D();

                        // create a new camera, passing some initialisation 
parameters
                        _camera3D = new Camera3D({zoom:15, focus:30, x:100, 
y:300,
z:-200});
                        _camera3D.lookAt( new Number3D( 0, 0, 0 ) );

                        // create a new view that encapsulates the scene and 
the camera
                        _view3D = new View3D( { scene:_scene3D, 
camera:_camera3D } );

                        // center the viewport to the middle of the stage
                        _view3D.x = 300;
                        _view3D.y = 200;
                        addChild(_view3D);
                }
                /////////////


                /////////////
                // CONSTRUCTOR
                public function Trial(){

                        // initialise Away3D
                        init3D();

                        // create the 3D objects
                        createScene();

                        // render
                        addEventListener( Event.ENTER_FRAME, onRender );
                }
                /////////////
}

Thanks for the answers and thanks for this great tool. ;)
Sorry for my English but i'm french...

Reply via email to