← All resources

Mini: 3D Rotation

Auto-discovered

Blog Beginner

Xor

Visit resource ↗

Description

Mini: 3D Rotation is a short GM Shaders Mini tutorial by Xor on rotating vectors in three dimensions with Euler angles and axis-angle formulas, following an earlier Mini on 2D rotation.

It shows stacking 2D rotate2D calls on yz, xz, and xy for roll, pitch, and yaw, notes order sensitivity and gimbal lock, then derives an axis-angle mix using a unit axis, cos and sin terms, a dot along the axis, and a cross-product side term in the style of Fabrice Neyret demos. It discusses when Euler fits game yaw or pitch, when arbitrary axes need axis-angle, and flags quaternions for later blending work.

It is for beginners to early intermediate shader writers who know GLSL vectors and 2D rotation. Dot and cross are explained in place.

Access is a free Substack-style article with inline GLSL in the GM Shaders Mini series.

It is useful as a compact Euler and axis-angle reference without a longer linear-algebra text.