oZone3D.Net Forums
Old Forums (No longer active) => GTruc Creation => Topic started by: LangFox on February 27, 2009, 10:30:43 AM

At first, I have to say that GLM is musthave for OpenGL developers.
But the quaternion could be optimized. It should be more efficient to make an axisangle format and have a function to rotate vector.
Finally, great work! Yet it can be better! ;D

You have very welcome! ;)
It actually depend how you use it. If you need to go back to the proper quaternion form, you lose a lot of benefice. If you really want to use a axis angle form, I think it would be better to simply use a vec3 and a scalar.
Have you some samples where you find advantages of axisangle?

Well, it is nothing important, just a little laziness, hehe.
My original math is:
sm_quat q(axis, theta);
vec3 result = q.rotate(v);
Now using GLM instead:
quat p(1.0, v.x, v.y, v.z);
quat q(cos(theta/2), axis.x*sin(theta/2), axis.y*sin(theta/2), axis.z*sin(theta/2));
quat result = cross(cross(q, p), conjugate(q));
Anyway, that doesn't matter. :saut: