-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
slerp issues #29
Comments
This looks another Dlang bug to me... writefln("---------> %s | %s", a.w * b.w + a.x * b.x + a.y * b.y + a.z * b.z, acos(a.w * b.w + a.x * b.x + a.y * b.y + a.z * b.z));
real theta = acos(a.w * b.w + a.x * b.x + a.y * b.y + a.z * b.z);
writefln("---------> %s", theta); produces: ---------> 1 | -nan
---------> -nan Which should obviously be Your version looks fine, I added it to the interpolation-module, thanks! |
Ok I think I figured it out, the result of the dot product is probably ever so slightly smaller than |
I have absolutely no idea why this is happening, but apprantly there are certain magical quaternions that cannot be interpolated between.
Having done a bit of research on slerp it turns out that its "bad practice" anyway:
http://physicsforgames.blogspot.com/2010/02/quaternions.html
http://number-none.com/product/Understanding%20Slerp,%20Then%20Not%20Using%20It/
If it is not too much trouble, I'd like to see nlerp along with a fixed version of slerp in the interpolate module.
My version looks like this:
, but I guarrantee nothing as the bug above is completely blowing my mind.
The text was updated successfully, but these errors were encountered: