# Quaternions to Degrees jump from -90 to 90

Cheers everybody,

I am using ZigSim to receive Quaternions from iPhone 11, and use the network from their Tutorial " Send motion data to PC" to rotate a Geo.

All works fine, except that the Quaternion degrees coming from Quaternion rz jump from -90 to 90 and vice versa, so instead of a smooth rotation, there is this interruption after 180deg of rotation on this axis.

I’ve been searching for hours, but couldn’t find an answer to my question – or anything I could comprehend, really. Is it possible to use the iPhone quaternion data for infinite, smooth rotations around this axis?

Help is appreciated!
Zappo

Interpolation of rotations needs to be in quaternions, and only at the very end should you change to Euler angles. It’s very normal to have large jumps in the rotations, but the whole ‘rotation’ composed for rx/ry/rz will be smoothly changing from frame to frame. You can’t just look at one channel (or use just one channel) due to the jumps that will occur.

2 Likes

Thanks for the quick reply! I think I understand where you’re coming from, and I might have phrased my problem wrongly. The rotation itself is fluent from frame to frame, but the object jumps to its mirrored position when rotated 180 degrees – I would like to be able to rotate 360 degrees without this jump. Am I not understanding the math at work, or is something missing in my network?

Found the issue after watching an ELI5 video on gimbal lock (titled “Euler (gimbal lock) Explained”)

The video’s recommendation of choosing the rotation hierarchy least likely to enter gimbal lock made me check the rotate order set in the Geo Comp. By changing it, I found an order that works without problems for my case. So I guess, I both framed my problem wrongly, and did not understand the math.

Thanks to Malcolm and GuerillaCG!

Solved!