Hi all! I am having some issues with rotations in moBu 2015. Maybe it's just me, or maybe it's a bug, or maybe i am forgetting something. BUT.
Say I have a cube, and I rotate it in X. It rotates in X.
Now I rotate it 90 degrees in Y.
Now when i rotate in X, it rotates in Z.
Global rotations, you say? It does the same thing on local...
I am streaming data into a device, and dependant on the Y value, the X and Z will be flipped. I don't mind telling you, it is driving me insane.
If anyone has any ideas I will buy you a cake.
thanks!
Hi,
the reason you have such a behaviour is gimbal lock. To see what happent you can switch to additive rotation mode (see attachment) and repeat your steps (rotate by x, then 90 degree by Y) and you will see that your X became Z axis now. Thats why mobu adds some 90 degree on Z euler to conpensate that.
So if you made some math on rotation, it's better to use quaternions.
Are you using existing device or making your own ?
You can try also to change axis order to better confirm your server data (see attachment, Rotation Order property).
We have made our own device, so there is every chance that it is an error. (Docs on mobu devices are few and far between!)
the part where we use the quats looks like this: (where tempRotW,X,Y,Z are the values that stream in via TCP from an IMU)
FBVector3d rot;
FBQuaternion quat(tempRotW, tempRotX, tempRotY, tempRotZ);
FBQuaternionToRotation(rot, quat);
then it is assigned:
FBProperty* lProperty = lModel->PropertyList.Find("lcl Rotation");
if (lProperty)
{
lProperty->SetData(rot);
}
This seems to be a pretty standard function. Are we doing this wrong?
thanks for your help!
Hi,
can you please write me on mail (s<at>neill3d<point>com) and I will try to help.
You may need 'global' type rotations and it may be reading "local".
You may need the SDK to pull them.
However, for now, if your element is parented,
get a new one and constrain it to the source,
then plot that object and remove the constraint.
This will then have "global" rotations, try with this one instead.
Can't find what you're looking for? Ask the community or share your knowledge.