MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rotation strangeness

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
859 Views, 6 Replies

Rotation strangeness

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!

 

 

6 REPLIES 6
Message 2 of 7
s
Advocate
in reply to: Anonymous

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.

---
Programming and Animation - neill3d.com
Message 3 of 7
Anonymous
in reply to: s

Hi, thanks for your reply. That is what I thought, so I switched from
euler to quaternions for my streaming data. I see the same result, axes
are flipped when y rotation passes 90 degrees.
Does this mean my quaternions are not being read properly in the mbDevice
perhaps?
Thanks again.
Message 4 of 7
s
Advocate
in reply to: Anonymous

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).

---
Programming and Animation - neill3d.com
Message 5 of 7
Anonymous
in reply to: s

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!

Message 6 of 7
s
Advocate
in reply to: Anonymous

Hi,

 

 can you please write me on mail (s<at>neill3d<point>com) and I will try to help.

---
Programming and Animation - neill3d.com
Message 7 of 7
3dMastermind
in reply to: s

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.

 


Manny Papamanos
StingRay | MotionBuilder | Maya | Mudbox
Games QA Specialist



Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report