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 python_inside_maya+unsubscr...@googlegroups.com.
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.

Reply via email to