I really hope that someone will help me with this, because I simply cannot figure it out and it is getting a bit desperate

I am trying to develop bird's flight.
I use SceneNode.Yaw to rotate the bird around Y axis I use SceneNode.Pitch to rotate the bird around X axis I use SceneNode.Roll to rotate the bird around Z axis I should point out that I am using degrees when dealing with the rotations, the most important rotations around Y should work like this

I should also point out that I am using my own method for rotation
Code: Select all
public static void Rotate(this SceneNode node, Vector3 rotationVector)
{
if (rotationVector.x != 0)
{
node.Pitch(new Degree(rotationVector.x).ValueRadians, Node.TransformSpace.TS_LOCAL);
}
if (rotationVector.y != 0)
{
node.Yaw(new Degree(rotationVector.y).ValueRadians, Node.TransformSpace.TS_PARENT);
}
if (rotationVector.z != 0)
{
node.Roll(new Degree(rotationVector.z).ValueRadians, Node.TransformSpace.TS_LOCAL);
}
}
Unfortunately there are few issues I am having with the rotations:
- It seems like roll, pitch and yaw somehow relate to each other. When I call Yaw with specific number and the other two (pitch and roll) are both 0, it works fine. Once they (pitch or roll) are changed it doesnt correctly yaw the scenenode.
- Is there a way how to get the rotation on Y axis? I thought that this would - sceneNode.Orientation.Yaw.ValueDegrees - is it, but it doesnt work correctly. For example, when there are no changes in pitch and roll, current rotation on Yaw is 29 degrees and I call Rotate function with 152 degrees in Y, it should return -179 degrees, but it returns -1. Why?
- What should I do to get the functionality that whatever the pitch and roll is, when I call Rotate(0,30,0) it will change the rotation on Y axis about 30 degrees?