How Can I Apply a Quaternion Rotation on a Local Axis After an Initial Rotation?

Click For Summary
SUMMARY

This discussion focuses on applying quaternion rotations sequentially while maintaining the local axes after an initial rotation. The user seeks to rotate an initial quaternion Q1 using two subsequent rotations, QX and QY, where QY must be applied to the local Y axis defined by Q1. The solution involves first applying QX to Q1 to obtain a new quaternion R1, then transforming QY into a new quaternion QY' that accounts for the rotation of the Y axis after QX is applied. Finally, QY' is applied to R1 to achieve the desired orientation.

PREREQUISITES
  • Understanding of quaternion mathematics and operations
  • Familiarity with quaternion multiplication and its noncommutative property
  • Knowledge of 3D rotation concepts and local vs. global axes
  • Experience with a 3D graphics engine or mathematics library that supports quaternions
NEXT STEPS
  • Study quaternion multiplication and its implications in 3D rotations
  • Learn how to transform local axes using quaternion rotations
  • Explore practical applications of quaternions in game development or computer graphics
  • Investigate libraries such as Unity's Quaternion class or DirectX Math for quaternion manipulation
USEFUL FOR

3D graphics developers, game developers, and anyone working with spatial transformations in computer graphics will benefit from this discussion.

Registred
Messages
4
Reaction score
0
Hey,

Once again, I got a question about quaternions.
Say I have an initial rotation Q1. I now want to rotate Q1 on the X and then on the Y axis. BUT: The Y rotation should apply to the local Y axis which was given in Q1.

The problem is:
If i rotate Q1 by the X-rotation Q2, then the Y axis changes for Q1*Q2. So, since quaternion multiplication is noncommutativ, if I then apply the Y-rotation Q3, I don't rotate about the original Y axis of Q1.

How can I rotate quaternions this way?

Greetings!
 
Mathematics news on Phys.org
I assume that the rotations around X and Y will be achieved by applying by two separate quaternion increments, call them QX and QY. Assuming this is the case I think you need to proceed as follows;

1. apply the QX rotation to Q1, call the result R1.
2. apply the QX rotation to the QY rotation increment - this transforms the Y axis rotation from the original frame of reference to the frame that exists after you've done the X rotation. Call the modified QY increment QY'
3. apply QY' to R1
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
67
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K