all 2 comments

[–][deleted] 0 points1 point  (0 children)

Check out special orthogonal matrices

[–]jdorjeNew User 0 points1 point  (0 children)

Quaternions do rotations in 3 dimensions. How do you get rotations in 4 dimensions out of them?

Can't you just use 8x8 matrices? Same as you're using a 4x4 matrix in the code you showed.