issue with jumping rotation (or gimbal lock) at certain angle

issue with jumping rotation (or gimbal lock) at certain angle

By : Stephan Benet
Date : November 19 2020, 03:59 PM
I wish this helpful for you after a long testing session and observation I could find out that there is no gimbal lock. and my edited calculation is correct:
code :
if(myPitch >= pitch + 1 || myPitch <= pitch - 1)
   int angle = myPitch > pitch ? 5: -5; // left or right tilt
   GLKVector3 vec = GLKVector3Normalize(GLKVector3Make(0, 1, 0));//rotate on y-axis (-1) is wrong
   double result = sinf(GLKMathDegreesToRadians(angle)/2);
   netRotY = GLKQuaternionMakeWithAngleAndAxis(cosf(GLKMathDegreesToRadians(angle)/2), vec.x *result, vec.y * result, vec.z * result);
   netRotY = GLKQuaternionNormalize(netRotY);

Share : facebook icon twitter icon
Will this cause gimbal-lock?

Will this cause gimbal-lock?

By : Jroen
Date : March 29 2020, 07:55 AM
hope this fix your issue If by OUT you mean "forward", and this is always perpendicular to the UP vector, then NO, you won't encounter gimbal lock.
What you are doing is creating an orientation matrix from the UP and FORWARD vectors, and applying that each frame, which is a fairly common method for moving a camera in space. You are not applying multiple rotations using euler angles, which can be a cause of gimbal lock.
Still seem to have a gimbal-lock using quaternions

Still seem to have a gimbal-lock using quaternions

By : user3125901
Date : March 29 2020, 07:55 AM
wish help you to fix your issue I have discovered the error of my ways ...
It lay in the code that maintains the rotated reference quaternion ... I should not have been multiplying it by the inverse ... in the following code snippet, the buggy code from the above question has been commented out.
code :
// rotate the zReferenceQuaternion quaternion by this change quaternion ...
//self.zReferenceQuaternion = [[change times:self.zReferenceQuaternion] times:[change inverse]];
self.zReferenceQuaternion = [change times:self.zReferenceQuaternion ];
[self.zReferenceQuaternion unitise];
Rotation issue on a horizontal angle

Rotation issue on a horizontal angle

By : Павел Пожетнов
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Your default value for rotation angle is 0, and the case UIDeviceOrientationFaceUp is not explicitly handled.
Alternatively, you could call [[UIApplication sharedApplication] statusBarOrientation] rather than [UIDevice currentDevice].orientation.
3D CSS Cube - Strange Rotation Inconsistency (Solved: Gimbal Lock)

3D CSS Cube - Strange Rotation Inconsistency (Solved: Gimbal Lock)

By : user3004626
Date : March 29 2020, 07:55 AM
wish of those help This is a normal problem with 3D rotation using 3 axes called Gimbal_lock
code :
const rotation_degree = { 'X': 0, 'Y': 0, 'Z': 0 };
const axisIdToAxis = { 'X': [1, 0, 0], 'Y': [0, 1, 0], 'Z': [0, 0, 1] };
const currentMatrix = new DOMMatrix;

$(document).on ("click", "button", function (e)
    const degree = parseInt ($(this).attr ("data-degree"));
    const axis   = $(this).attr ("data-axis");
    // Animate on an unused property
    $(".cube").css ("text-indent", rotation_degree[axis]);
    $('.cube').animate (
        textIndent: rotation_degree[axis] + degree
        step: function (now,fx) 
            rotation_degree[axis] = now;

            // Center cube in scene
            const transform = `translateZ(-50px) rotate${axis}(${now}deg) ${currentMatrix}`;
            $(this).css ('transform', transform);  
        complete: function() {
            // apply rotation to currentMatrix
               new DOMMatrix().rotateAxisAngleSelf(
                  ...axisIdToAxis[axis], degree));
            // zero this out since we applied it above
            rotation_degree[axis] = 0;

        duration: 'slow',
        queue: true,

html, body {
    width: 100%;
    height: 100%;

.scene {
    width: 100px;
    height: 100px;
    perspective: 100px;
    background-color: rgb(0,0,0);

.cube {
    transform: translateZ(-50px);
    text-indent: 0;

.face {
    width: 100%;
    height: 100%;
    position: absolute;
    background-color: rgba(3, 121, 255, 0.5);
    color: #FFF;
    line-height: 100px;
    text-indent: 0;
    text-align: center;

.front  { transform: rotateY(0deg)    translateZ(50px); }
.right  { transform: rotateY(90deg)   translateZ(50px); }
.left   { transform: rotateY(-90deg)  translateZ(50px); }
.back   { transform: rotateY(180deg)  translateZ(50px); }
.top    { transform: rotateX(90deg)   translateZ(50px); }
.bottom { transform: rotateX(-90deg)  translateZ(50px); }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="scene">

    <div class="cube">
        <div class="face front">front</div>
        <div class="face right">right</div>
        <div class="face left">left</div>
        <div class="face back">back</div>
        <div class="face top">top</div>
        <div class="face bottom">bottom</div>

<button data-degree="45" data-axis="X">
    X-Axis (+)

<button data-degree="-45" data-axis="X">
    X-Axis (-)

<button data-degree="45" data-axis="Y">
    Y-Axis (+)

<button data-degree="-45" data-axis="Y">
    Y-Axis (-)

<button data-degree="45" data-axis="Z">
    Z-Axis (+)

<button data-degree="-45" data-axis="Z">
    Z-Axis (-)
Rotate model around x,y,z axes, without gimbal lock, with input data always as x,y,z axes angle rotations

Rotate model around x,y,z axes, without gimbal lock, with input data always as x,y,z axes angle rotations

By : Kim Eujong
Date : March 29 2020, 07:55 AM
I wish this helpful for you If your device is giving you absolute X/Y/Z angles (which implies something like actual gimbals), it will have some specific sequence to describe what order the rotations occur in.
Since you say that "the order doesn't matter", this suggests your device is something like (almost certainly?) a 3-axis rate gyro, and you're getting differential angles. In this case, you want to combine your 3 differential angles into a rotation vector, and use this to update an orientation quaternion, as follows:
Related Posts Related Posts :
  • Unclear about releasing CFDictionaryRef
  • CordovaError: Promise rejected with non-error: Error code 65
  • How to append NSMutable strings into a UILabel
  • CustomCell label value does not change
  • Display ad in iAd Bannerview iAd Network
  • Warning: "Could not get traitsetID for iPhone11,6" (Assets.xcassets)
  • Changing root view controller after iOS app has loaded.
  • SocketRocket and iOS certificate pinning
  • Draggable UIButton Snap To a Circle Path
  • Running FireBase in the background
  • resizing UIPopoverController to fit UITableController
  • UICollectionView Exception Crash
  • targeting iOS5 - will it work on iOS6 also?
  • FBLoginView get email
  • Scale UIImages height to UIImageView height
  • Creating a custom progress indicator in ios
  • NSRunLoop API difference
  • Is it possible to inject custom settings into my iOS application "Notifications" settings dialog?
  • UIAlertview not accepting string as message
  • Axis change of stackView giving layout error
  • How to use AVAssetResourceLoader?
  • How to write block definition using properties?
  • iOS connect/reconnect to Bluetooth device when using external-accessory and MFi
  • Saving XMPP Multi User chat messages through XMPP MessageArchiving in iOS
  • Deciding iOS version: pros and cons
  • iOS: Resigned app cannot access keychain through security API
  • How can I set To and Subject fields in an E-Mail being sent by UIDocumentInteractionController?
  • Updating uilabel in view controller underneath another
  • Maximum time Intervel for NSTimer
  • Delete Core Data Entry from Table View Controller
  • How to unload UIViewcontroller from memory?
  • Compressing UIImage as Far as Possible?
  • Optimizing workflow to update internally owned cocoapods dependencies?
  • Formatting an NSDate with Abbreviated Month/Day Names
  • I'm creating a quiz game with 4 answers and I want to add score
  • Tap Gesture to Hide Navigation Bar, Tab Bar, and Status Bar
  • FBSessionStateClosedLoginFailed when I am logged in through Settings
  • CGRect positioning according to center point
  • iOS: Update table view datasource with animations without core data
  • iOS : Where to start for AliPay integration?
  • Routing App Coverage File missing but not needed?
  • Drawing on a zoomable view
  • Append NSStrings and NSNumber to NSMutableArrays and make NSMutable dictionary
  • Terminating app due to uncaught exception 'NSRangeException' when calling dequeueReusableCellWithReuseIdentifier:forInde
  • Collision without physics (Cocos2D + Box2D iOS)
  • Creating a percentage based iOS layout
  • Update tableView row from AppDelegate Swift 4
  • Assigning return value of a class method to a variable error
  • how to display circular progress in delphi ios apps?
  • I can't figure how to fix this Expected identifier or '('
  • How to Test APIs in Swift 4?
  • Link error /Build/Products/Debug-iphonesimulator file not found
  • working with a very large JSON object in iOS
  • Turn off part of the iPhone Screen
  • Phonegap 3.0 app with facebook login using xCode
  • How to add interstitial admob ads to my ios project
  • adding tapku calendar to ios app
  • Add an alertcontroller in a global swift file?
  • Take square image with Cordova (Phonegap) Camera API?
  • Amazon S3 policy allowing only upload not overwrite
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org