I believe I have found a bug in the matrix class. Using the following code causes the scene node to become stuck at 90° and 270° on the y axis. Rotations seems to work well around the x and z axes.
here is the code but I am using:
float t = pDevice->getTimer()->getTime ()/1000.0f;
matrix4 mat;
mat.setRotationDegrees( testSceneNode->getRotation() + vector3df(0,1,0) );
testSceneNode->setRotation( mat.getRotationDegrees() );
I have also found a similar bug when using the quaternion class.specifically issues with the toEuler function.
[no bug]rotational around y axis appears broken for matrices
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
-
- Posts: 105
- Joined: Mon Jul 27, 2009 4:06 pm
- Location: Cambridge, MA
The rotation api exposed for most nodes uses a parametrization known as euler angles. While euler angles are capable of describing any orientation, determining the euler angles from a particular orientation can be ambiguous. In other words, the mapping from euler angles to an orientation in space is many to one. This mathematical phenomenon leads to a problem known as gimbal lock at high "pitch" (rotation about the 'Y' for this particular set of euler angles). See Fuzzy's link for more information about that.
If you want to operate at arbitrary angles and the standard rotation API for most nodes is not sufficient, put a DummyTransformationSceneNode as the parent of the node you're trying to rotate, and you can set it's orientation directly using the transformation matrix.
If you want to operate at arbitrary angles and the standard rotation API for most nodes is not sufficient, put a DummyTransformationSceneNode as the parent of the node you're trying to rotate, and you can set it's orientation directly using the transformation matrix.
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact: