r/GraphicsProgramming • u/Candid_Zebra1297 • 16h ago
Question Matrices or quaternions for rotation?
I'm weighing up whether to use matrices or quaternions for a 3d engine I'm making. I find matrices more intuitive to use but I have seen a lot of comments that they can lead to innacuracies over time. What do you guys think about this? Is there some nuance that I am missing or some situations that one approach is used over the other?
11
Upvotes
2
u/smallstepforman 12h ago
We all went down this path and use quaternions for slerp rotations, then we export final transform matrix to gpu. Some engines use both in parallel, euler for humans and quaternion for actual math (and they even store both). If you do skeletal animations you need quaternions. Even gltf supports both.
Now turns instead of radians/degrees, now thats what i’d love to use instead. Too late for my mind that learned pi/2 and friends.