There actually is another way using Rotors (from Geometric Algebra). Rotors are just like quaternions but represented in an easier to understand format. Check out Marc ten Bosch's work. Also if you like math, watch some lectures about Geometric Algebra (Sigraph or GAME2020), I think it might change the face of computer graphics and physics in the coming decades.
there must be a (less efficient) way of solving this problem without using quaternions? Or is it the only solution?
There actually is another way using Rotors (from Geometric Algebra). Rotors are just like quaternions but represented in an easier to understand format. Check out Marc ten Bosch's work. Also if you like math, watch some lectures about Geometric Algebra (Sigraph or GAME2020), I think it might change the face of computer graphics and physics in the coming decades.
Can I get the code of this?
I can give advice, nothing more. This project is under development.