Last active
December 31, 2018 07:29
-
-
Save serguei-k/7613753662f2dc9ab8f4ecce267735ef to your computer and use it in GitHub Desktop.
Variable FK 3
This file contains hidden or 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
// ... | |
MMatrix xform = sampleFrames[i]; | |
const MVector aim(xform[0][0], xform[0][1], xform[0][2]); | |
const MVector p1(xform[3][0], xform[3][1], xform[3][2]); | |
const MVector p2(sampleFrames[next][3][0], | |
sampleFrames[next][3][1], | |
sampleFrames[next][3][2]); | |
const MVector newAim = (p2 - p1).normal(); | |
const MQuaternion offset(aim.angle(newAim), aim ^ newAim); | |
xform = xform * offset.asMatrix(); | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment