Ok, in creating a minimal reproduction of this bug I discovered the exact
do's and don'ts of object rotation after loading it. Confirmed for both
Collada and Obj, and on 3.3 stable and the latest svn build.

 

If you rotate the object immediately after loading it (myMesh.rotationX=90),
then applyRotations() later, in the onLoadSuccess method, it works.

 

If you rotate AND applyRotations() together, either immediately after
loading, or together in onLoadSuccess, it will not rotate the object at all
(it maintains its default orientation).

 

I'll post the minimal reproduction to the issues list now.

 

Thanks!

Dave

 

 

From: [email protected] [mailto:[email protected]] On
Behalf Of Peter Kapelyan
Sent: Wednesday, July 22, 2009 8:31 PM
To: [email protected]
Subject: [away3d] Re: Having trouble to initially applyRotation to a mesh
after Obj.load(url)

 

If it's not working as expected (in the  onLoadSuccess), it sounds like a
bug, worth replicating and putting into the issue list.

It might be a bit messy hack for now, but you can throw that OBJ into a
ObjectContainer3D and rotate that group.

-Pete

On Wed, Jul 22, 2009 at 7:25 AM, David Parks <[email protected]> wrote:

Thanks for all the help so far, I've gotten further in generating a terrain,
but ran into a problem using applyRotations() with my mesh.

 

At what point can I call applyRotations() after calling Obj.load(url)?

 

When I load a mesh I need to rotate it from its default orientation.

 

It works fine if I set myObject3D.rotationX=90, and don't applyRotations().
If I call applyRotations() then the mesh loads with the default orientation.

 

Seems easy enough, but when I call applyRotations() immediately upon calling
Obj.load(url), I think it is applying the rotation to the temporary cube
loader, and then later loading the mesh in its default orientation. Even a
call to applyRotations() from within the loaders onLoadSuccess event handler
it doesn't apply the rotation to the final mesh.

 

Thanks as always for your suggestions!

Dave

 

 

 




-- 
___________________

Actionscript 3.0 Flash 3D Graphics Engine

HTTP://AWAY3D.COM

Reply via email to