Home / Forums / Quaternions vs Euler Angles in 3D Rotation: Eliminating Gimbal Lock

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Tutorial

Quaternions vs Euler Angles in 3D Rotation: Eliminating Gimbal Lock

MatrixRecon
3D Math & Vectors
MEMBER
Rep: 225
Join Date: Jan 2025
Posts: 33
Thanks: 55
3y ago · Nov 26, 2022 3:35 PM
#1
Euler angles suffer from Gimbal Lock when pitch reaches 90 degrees. Quaternions represent 3D orientation as a 4D unit sphere (w, x, y, z).
MatrixRecon · 3D Mathematics & View Matrix Calculations
The following users thanked MatrixRecon for this post:
AimbotMath
Trigonometry & Smoothing
MEMBER
Rep: 285
Join Date: Nov 2023
Posts: 27
Thanks: 73
3y ago · Nov 26, 2022 7:40 PM
#2
SLERP (Spherical Linear Interpolation) provides smooth constant-angular-velocity transitions between two orientations.
AimbotMath · Angular Normalization & Smooth Angles
ApexPredator_
Source Engine Modder
VIP
Rep: 340
Join Date: May 2022
Posts: 23
Thanks: 88
3y ago · Nov 28, 2022 2:40 AM
#3
Converting a Quaternion to a 4x4 rotation matrix is very efficient for feeding into graphics projection pipelines.
ApexPredator_ · Source Engine Specialist