Created
September 11, 2015 16:46
-
-
Save usefulslug/1a925ed706fd8ab80808 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tries to compute sensible tangent values for the quaternion | |
def Intermediate(q0 as Quaternion, q1 as Quaternion, q2 as Quaternion): | |
q1inv as Quaternion = Quaternion.Inverse(q1) | |
c1 as Quaternion = q1inv * q2 | |
c2 as Quaternion = q1inv * q0 | |
c1.Log() | |
c2.Log() | |
c3 as Quaternion = c2 + c1 | |
c3.Scale(-0.25) | |
c3.Exp() | |
r as Quaternion = q1 * c3 | |
r.Normalize() | |
return r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment