Gimbal lock is the loss of one degree of freedom in a three-dimensional, three-gimbal mechanism that occurs when the axes of two of the three gimbals are driven into a parallel configuration, "locking" the system into rotation in a degenerate two-dimensional space.
In practice, we observe gimbal lock in 3D scenes when the camera cannot pivot smoothly in a great circle (360-degrees) in any given direction.
Expected behavior
After launching a holographic scene with the Looking Glass polyfill, we expect to be able to continuously drag "down" to rotate (pitch) about an object by 360 degrees.
Observed behavior
After launching a holographic scene with the Looking Glass polyfill, we can drag "down" to rotate (pitch) the object by 90 degrees. At that point dragging "up/down" or "left/right" appears to roll the object, but can no longer pitch the object in the same direction.
Send to Looking Glass and double-click to maximize
Try to click and drag the scene straight up or straight down. We would expect that the camera remains centered between the two cubes, but instead after a 90-degree pitch the cubes begin to roll about the camera forward vector.
Common resolution is to use quaternions internally for full DOF in rotation computations
The issue is observed in Looking Glass WebXR, but have not confirmed whether it originates here or in the underlying WebXR polyfill on which the Looking Glass WebXR polyfill is based.
Background
From Wikipedia:
In practice, we observe gimbal lock in 3D scenes when the camera cannot pivot smoothly in a great circle (360-degrees) in any given direction.
Expected behavior
After launching a holographic scene with the Looking Glass polyfill, we expect to be able to continuously drag "down" to rotate (pitch) about an object by 360 degrees.
Observed behavior
After launching a holographic scene with the Looking Glass polyfill, we can drag "down" to rotate (pitch) the object by 90 degrees. At that point dragging "up/down" or "left/right" appears to roll the object, but can no longer pitch the object in the same direction.
Steps to Reproduce
Reproduced in React-Three-Fiber example: https://docs.lookingglassfactory.com/developer-tools/webxr/react-three-fiber
Steps:
Can also reproduce with VolView experimental holographic support: https://deploy-preview-438--volview-dev.netlify.app/
Additional Notes