kottore / away3d

Automatically exported from code.google.com/p/away3d
0 stars 0 forks source link

Setting rotationX property on Object3D results in rotation in the opposite direction #100

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Construct an Object3D
2. Set the rotationX using the rotationX setter
3. Inspect the transform of the Object3D.  Notice that the x rotation is 
opposite what it should 
be

Try the following code:

            var matrix:MatrixAway3D = new MatrixAway3D();
            matrix.rotationMatrix(1, 0, 0, 90 * Math.PI / 180);
            trace("matrix after matrix.rotationMatrix of 90: \n" + matrix);

            var object3D:Object3D = new Object3D();
        object3D.rotationX = 90;
        trace("object 3D after setting rotationX to 90: \n" + object3D.transform);

What is the expected output? What do you see instead?

I would expect the output to be:

matrix after matrix.rotationMatrix of 90: 
1       0       0       0
0       0       -1      0
0       1       0       0
0       0       0       1

object 3D after setting rotationX to 90: 
1       0       0       0
0       0       -1      0
0       1       0       0
0       0       0       1

What I get instead is:

matrix after matrix.rotationMatrix of 90: 
1       0       0       0
0       0       -1      0
0       1       0       0
0       0       0       1

object 3D after setting rotationX to 90: 
1       0       0       0
0       0       1       0
0       -1      0       0
0       0       0       1

What version of the product are you using? On what operating system?
trunk/fp10/Away3D, on Mac OS X 10.6.2

Please provide any additional information below.

The problem appears to be this line in Object3D, although I'm not sure what the 
implications are 
of changing it:

462             _quaternion.euler2quaternion(_rotationY, _rotationZ, 
-_rotationX); // Swapped

Original issue reported on code.google.com by poshaugh...@gmail.com on 5 Mar 2010 at 7:26