You need to use MQuaternion , go take a look at MFnTransform or 
MFnTransformation ( I don’t know which it is)  and see the parts where it 
mentions MQuaternion , can’t remember it at the top of my head but you can have 
any angle with your quaternion in radians of course so past 180 deg like you 
want ( pi ) past 360 degrees ( 2 pi ) …

Sent from Mail for Windows 10

From: Michael Boon
Sent: Wednesday, March 21, 2018 12:52 AM
To: Python Programming for Autodesk Maya
Subject: [Maya-Python] Re: Getting rotations beyond -180 to 180 degree 
rangefrom matrix

In most cases, if you're trying to average rotations, quaternions will give you 
much more intuitive results. Quaternions don't get gimbal lock, so they don't 
do weird things when the euler angles get near 90 degrees. One weird thing they 
do (which might suit you given the subject) is that they support angles up to 
+-360 degrees.

If you use the OpenMaya.MQuaternion class, it has a slerp function that will do 
your interpolation for you.

Generally speaking (though it will depend on your specific code) quaternions 
are faster than matrices or euler angles for interpolating angles too.

However off the top of my head, I can't remember how to get or set object 
rotation as quaternion in Maya. Someone else might know?

On Tuesday, 20 March 2018 09:52:20 UTC+11, derek wong wrote:
I was getting the arccos of dot products between cubeA and cubeC to determine 
angular differences.

I just wasn't sure if I was using the entirely wrong method, or if I was 
ignorant about something that would make it work, but now I know it was the 
former.

Thanks for the help!
-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/c5861edd-f7b8-476f-838a-6bfd73251aa7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/5ab1bd25.0eaddf0a.850f5.e18f%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to