Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4047628
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:42:51+00:00 2026-05-20T13:42:51+00:00

Instead of Euler angles I moved to Quaternions to represent and process the rotation

  • 0

Instead of Euler angles I moved to Quaternions to represent and process the rotation of a cube in 3D. Although it would solve gimbal lock, I’m still experiencing this issue.

My code is:

// p is the point to be rotated
// angles is a Vector3D representing the rotation angles

var xaxis = new Vector3D(1, 0, 0);
var yaxis = new Vector3D(0, 1, 0);
var zaxis = new Vector3D(0, 0, 1);

p = rotate(p, xaxis, angles.x);
p = rotate(p, yaxis, angles.y);
p = rotate(p, zaxis, angles.z);

The rotate functions comes from http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Pseudo-code_for_rotating_using_a_quaternion_in_3D_space (translated into JavaScript).

I guess the problem is due to the fact that I still use an order of axes (x y z) which is the main problem of gimbal lock.

How would one implement quaternion rotation in such a way that gimbal lock is solved?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T13:42:52+00:00Added an answer on May 20, 2026 at 1:42 pm

    Quaternions are not susceptible to gimbal lock, so that’s not your problem. If your
    x, y, and z angles are intended to represent something like Euler angles, the issue
    is more likely that you’re defining xaxis, yaxis, and zaxis relative to the original
    coordinate system. But that won’t give the expected results, because after the first
    rotation around xaxis, the Y and Z axes don’t point in the original directions
    any more, yet the next two rotations are still referenced to the original coordinate
    system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Instead of hardcoding the default @author template I would like Eclipse to use user's
Instead of writing ((x: Double) => (((y: Double) => y*y))(x+x))(3) I would like to
I am working to solve a problem that is a bit similar to Euler
Instead of using an animated gif, I would like to instead have text in
Tell me if I am wrong. I'm starting using quaternions. Using a rotation matrix
Here is the problem I am trying to solve: Euler 20 . n! means
Instead of renting a server on Amazon and other hosting companies (which would cost
Instead of using std::vector<Object> ObjectArray; I would like it to be MyArray<Object> ObjectArray; with
In order to solve the Euler Project problem n°5 , I wrote the following
Instead of typing PsIsContainer, I would like to be able to use either dir

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.