Skip to content

Instantly share code, notes, and snippets.

@serguei-k
Last active December 31, 2018 07:29
Show Gist options
  • Save serguei-k/7613753662f2dc9ab8f4ecce267735ef to your computer and use it in GitHub Desktop.
Save serguei-k/7613753662f2dc9ab8f4ecce267735ef to your computer and use it in GitHub Desktop.
Variable FK 3
// ...
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