john-chapman / im3d

Immediate mode rendering and 3d gizmos.
MIT License
1.21k stars 63 forks source link

Quaternion support #19

Closed john-chapman closed 6 years ago

john-chapman commented 7 years ago

http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/functions/

john-chapman commented 6 years ago

The implementation would simply convert quat -> mat3 and then call the existing Gizmo functions, so explicit support for quaternions isn't strictly necessary. Indeed, overloading the Gizmo functions is difficult since all the arguments are float*.

Converting quat -> mat3 and back would obviously incur some precision loss however it's probably acceptable (and the return conversion can be avoided if the Gizmo function returns false).