1 Reply Latest reply: Nov 6, 2011 1:57 PM by pdesmeules RSS

    DAE loaded successfully but scaled


      Hi, I successfully loaded a dae model I did in 3dsmax. The model doesn't have the same dimensions in the proscenium viewport than in max.  I wonder if there is a way to load it in the correct scale i.e. the one I work with in max.


      I tried to scale the model to its correct dimensions using the newly created sceneMesh boundingBox and a strange thing happens. If I access the sceneMesh boundingBox just after loading to calculate the scale ratios, the scale transformation (mesh.transform.appendScale...) won't apply. If I hardcode the scale ratios without accessing the sceneMesh boundingBox, It works.


      How should I do to scale my model in its original dimensions ?


      You can reproduce by replacing onLoad mehod of Tutorial08_LoadedAnimation by this one. The model is scaled by a factor of 2 (x,y,z). If you uncomment the two lines above, you'll see that the model is not scaled at all + it is broken.


      public function onLoad( event:Event ):void {

                                    var node:SceneMesh = new SceneMesh();

                                    scene.addChild( mesh );

                                    var manifest:ModelManifest = loader.model.addTo( mesh );

                                    var bounds:BoundingBox = new BoundingBox();

                                    //bounds = mesh.boundingBox;

                                    //mesh.transform.appendScale(18 / (bounds.maxX - bounds.minX),12 / (bounds.maxY - bounds.minY), 12 / (bounds.maxZ - bounds.minZ));



                                    animations = loader.model.animations;

                                    for each ( var anim:AnimationController in animations ) {

                                              anim.bind( scene );



                                    for each ( var material:Material in manifest.materials )


                                              trace( material );



                                    initialized = true;