Julio Jerez wrote:can you make a sketch of what you want to do? I am having a difficult time figure out what the problem is.
I may be able to give you some solution.
Indeed - I can send you a small test app that will illustrate everything - here is a link to it (public dropbox loc)
http://dl.dropbox.com/u/10506379/Tutorial_102_5_TestingEuler.exe You should place it into "..\NewtonTutorials\bin\x32", as it needs "frowny.dat" and "dumb.dat" objects.
What you will see is two "dumbell" objects, and one "Frowny" which is designating space origin (0,0,0). The top "dumbell" can be rotated around its local axis:
x axis: X/ShiftX
y axis: Y/ShiftY
z axis: Z/ShiftZ
immediately stop rotation: "C" key
add/subtract thrust along z axis: Space/ShiftSpace
Initially, the top dumbell is correctly rotated at 30,40,10 degrees (which is visible in the readout). Basically, when I rotate only around Y axis (pressing Y/ShiftY key), I want the Y rotation value (that reads 40) to show increase/decrease. Same with Z. Right now, if I rotate around Y or Z, other values change, and that's because the angles displayed are PYR angles around global axis. I need angles around local axis. X works as it should - I am not sure why, but I am guessing its because it is first in line for rotation so the values are still correct. I am getting those rotation values by calling
- Code: Select all
EulerXYZ = rotation.GetXYZ_EulerAngles();
and displaying EulerXYZ.m_x, m_y, m_z values. (EulerXYZ.m_x behaves correctly)
The omega readouts behave correctly - they display the omegas on the LOCAL axis only. That is, when I apply torques on individual axis, other omegas are "still". I need the same thing, but for angles. I hope this clears it up... I am sure there is an elegant way of using this - some combination of rotating quaternions to get to local axis...
Thanks a bunch!!
Misho
PS: Incidentally, this is a very common thing in flight simulation - the roll, pitch and yaw are always displayed from the aircraft's internal frame of reference...