Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.1.6 Bug with rotationZ on ObjectContainer3D, it uses global Z axis instead of local Z axis #697

Open
lvignals opened this issue May 21, 2014 · 2 comments

Comments

@lvignals
Copy link

Hi! I noted that since 4.1.6 (Master or Dev branch) the ObjectContainer3D rotate() function is using the global Z axis (only for Z) instead of the local Z axis. Below is a sample with the breaking code from 4.1.4 Gold (working as expected) to 4.1.6 (Master or Dev, not working as expected)

//For ObjectContainer3D since 4.1.6 and above
if (...) rotate(Vector3D.Y_AXIS, -YAW * dt); //causes rotation around local Y
if (...) rotate(Vector3D.Y_AXIS, YAW * dt); //causes rotation around local Y
if (...) rotate(Vector3D.X_AXIS, PITCH * dt); //causes rotation around local X
if (...) rotate(Vector3D.X_AXIS, -PITCH * dt); //causes rotation around local X
if (...) rotate(Vector3D.Z_AXIS, ROLL * dt); //causes rotation around GLOBAL Z (Issue)
if (...) rotate(Vector3D.Z_AXIS, -ROLL * dt); //causes rotation around GLOBAL Z (Issue)

Thanks and great work on Away3d, great library!

@lvignals lvignals changed the title since 4.1.6 rotateZ() on ObjectContainer3D uses global Z axis instead of local Z axis 4.1.6 Bug with rotationZ on ObjectContainer3D, it uses global Z axis instead of local Z axis May 21, 2014
@lvignals
Copy link
Author

Using the rotationZ property instead of the rotate() function carries the same issue:

rotationZ += ROLL * dt; //same Issue
rotationZ -= ROLL * dt; //same Issue

To reproduce issue: load a model in an ObjectContainer3D.
Rotate the model along Y by 90 degrees (model will Yaw as expected) then Rotate along Z and you will find that your model Picth is affected instead of the Roll because rotationZ is using the Global Z Axis instead of the local Z axis which should have been rotated 90 degrees since the ObjectContainer3D was first rotated along Y by 90 degrees.

I hope that helps :-)

@SharpEdgeMarshall
Copy link

You are right! I've searched in commits and it's not so easy to found the cause!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants